summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorsuz <suz@FreeBSD.org>2002-04-10 04:18:42 +0000
committersuz <suz@FreeBSD.org>2002-04-10 04:18:42 +0000
commit50a9baacb4f8e57e98d549545dd9cc55233f86ea (patch)
tree3117bf4f4e3b993905d6174d789e4d846ccf3370 /sys/net
parentce939dfab8432eb9cf7f840d81e9babf681de28a (diff)
downloadFreeBSD-src-50a9baacb4f8e57e98d549545dd9cc55233f86ea.zip
FreeBSD-src-50a9baacb4f8e57e98d549545dd9cc55233f86ea.tar.gz
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
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 854a879..1b64e91 100644
--- a/sys/net/if.c
+++ b/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
OpenPOWER on IntegriCloud