diff options
author | peter <peter@FreeBSD.org> | 1995-07-31 10:35:36 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-07-31 10:35:36 +0000 |
commit | b6ccb9009ac731bcfa2691926d47c850c895e0c3 (patch) | |
tree | 87a04d5212f966e775b7134429cef9688f05641f /sys | |
parent | fd35d46e41e41817874f8f31871fecd2e24627af (diff) | |
download | FreeBSD-src-b6ccb9009ac731bcfa2691926d47c850c895e0c3.zip FreeBSD-src-b6ccb9009ac731bcfa2691926d47c850c895e0c3.tar.gz |
Fix panic("ifpromisc failed") when shutting down a bpf tap when the attached
interface is no longer IFF_UP.
The test for IFF_UP in ifpromisc is only useful while enabling IFF_PROMISC
and the higher levels of the bpf code do not allow for the possibility of
failure while shutting down. This is a trivial change.
Also, fixes PR#522.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/bpf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index af05e83..e292203 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -37,7 +37,7 @@ * * @(#)bpf.c 8.2 (Berkeley) 3/28/94 * - * $Id: bpf.c,v 1.8 1995/06/15 18:10:57 pst Exp $ + * $Id: bpf.c,v 1.9 1995/07/16 10:13:08 bde Exp $ */ #include "bpfilter.h" @@ -1314,14 +1314,14 @@ ifpromisc(ifp, pswitch) int pswitch; { struct ifreq ifr; - /* - * If the device is not configured up, we cannot put it in - * promiscuous mode. - */ - if ((ifp->if_flags & IFF_UP) == 0) - return (ENETDOWN); if (pswitch) { + /* + * If the device is not configured up, we cannot put it in + * promiscuous mode. + */ + if ((ifp->if_flags & IFF_UP) == 0) + return (ENETDOWN); if (ifp->if_pcount++ != 0) return (0); ifp->if_flags |= IFF_PROMISC; |