diff options
author | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2007-02-12 22:36:48 +0000 |
---|---|---|
committer | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2007-02-12 22:36:48 +0000 |
commit | e54c4c41ee6b9d3584866e3234367d7a78ee457f (patch) | |
tree | 43750192f8e1d00f8cbdd6511b2220a35d5f93a1 /sys/net/if.c | |
parent | a03f82c0981705ca1ff579de1839fc64070f8e52 (diff) |
Don't pass random flags to SIOIFFLAGS when changing the lladdr.
OK tedu@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 6e157e572c1..fa1ca942f17 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.153 2006/12/03 13:41:19 reyk Exp $ */ +/* $OpenBSD: if.c,v 1.154 2007/02/12 22:36:47 mpf Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1345,11 +1345,14 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p) return (ENODEV); } if (ifp->if_flags & IFF_UP) { + struct ifreq ifrq; int s = splnet(); ifp->if_flags &= ~IFF_UP; - (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr); + ifrq.ifr_flags = ifp->if_flags; + (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifrq); ifp->if_flags |= IFF_UP; - (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr); + ifrq.ifr_flags = ifp->if_flags; + (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifrq); splx(s); TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { if (ifa->ifa_addr != NULL && |