mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
fixed a kernel crash when enabling multicast on vlan interface
owing to a NULL argument to vlan_ioctl() at if_allmulti(). Reviewed by: ume MFC after: 1 week
This commit is contained in:
parent
7edfb592df
commit
ee0a4f7ee7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=94344
13
sys/net/if.c
13
sys/net/if.c
@ -1646,11 +1646,13 @@ if_allmulti(ifp, onswitch)
|
||||
{
|
||||
int error = 0;
|
||||
int s = splimp();
|
||||
struct ifreq ifr;
|
||||
|
||||
if (onswitch) {
|
||||
if (ifp->if_amcount++ == 0) {
|
||||
ifp->if_flags |= IFF_ALLMULTI;
|
||||
error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, 0);
|
||||
ifr.ifr_flags = ifp->if_flags;
|
||||
error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr);
|
||||
}
|
||||
} else {
|
||||
if (ifp->if_amcount > 1) {
|
||||
@ -1658,7 +1660,8 @@ if_allmulti(ifp, onswitch)
|
||||
} else {
|
||||
ifp->if_amcount = 0;
|
||||
ifp->if_flags &= ~IFF_ALLMULTI;
|
||||
error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, 0);
|
||||
ifr.ifr_flags = ifp->if_flags;
|
||||
error = ifp->if_ioctl(ifp, SIOCSIFFLAGS, (caddr_t)&ifr);
|
||||
}
|
||||
}
|
||||
splx(s);
|
||||
@ -1870,9 +1873,11 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, int len)
|
||||
*/
|
||||
if ((ifp->if_flags & IFF_UP) != 0) {
|
||||
ifp->if_flags &= ~IFF_UP;
|
||||
(*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, NULL);
|
||||
ifr.ifr_flags = ifp->if_flags;
|
||||
(*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr);
|
||||
ifp->if_flags |= IFF_UP;
|
||||
(*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, NULL);
|
||||
ifr.ifr_flags = ifp->if_flags;
|
||||
(*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr);
|
||||
#ifdef INET
|
||||
/*
|
||||
* Also send gratuitous ARPs to notify other nodes about
|
||||
|
Loading…
Reference in New Issue
Block a user