diff options
author | brian <brian@FreeBSD.org> | 2001-04-02 21:49:40 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-04-02 21:49:40 +0000 |
commit | c7f3f4f6921573ef6761629ae1b756376e15cc3a (patch) | |
tree | 70c8c49a34a87d9cc29c768eb726b74c500f0bc5 /sys | |
parent | 146874eeb60194504260bddae9aade5f1222d6bb (diff) | |
download | FreeBSD-src-c7f3f4f6921573ef6761629ae1b756376e15cc3a.zip FreeBSD-src-c7f3f4f6921573ef6761629ae1b756376e15cc3a.tar.gz |
If ifpromisc() fails the SIOCSIFFLAGS ioctl, put ifp->if_flags
back the way we found them.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 2598907..08c4a1f2 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1016,7 +1016,9 @@ ifpromisc(ifp, pswitch) { struct ifreq ifr; int error; + int oldflags; + oldflags = ifp->if_flags; if (pswitch) { /* * If the device is not configured up, we cannot put it in @@ -1040,6 +1042,8 @@ ifpromisc(ifp, pswitch) error = (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifr); if (error == 0) rt_ifmsg(ifp); + else + ifp->if_flags = oldflags; return error; } |