From c7f3f4f6921573ef6761629ae1b756376e15cc3a Mon Sep 17 00:00:00 2001 From: brian Date: Mon, 2 Apr 2001 21:49:40 +0000 Subject: If ifpromisc() fails the SIOCSIFFLAGS ioctl, put ifp->if_flags back the way we found them. --- sys/net/if.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys') 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; } -- cgit v1.1