diff options
author | thompsa <thompsa@FreeBSD.org> | 2005-08-27 01:17:42 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2005-08-27 01:17:42 +0000 |
commit | c61e7755271e1ceb08f1f727231ea9a16676178e (patch) | |
tree | bc2004c296f91f47a979144c6d569527a7bdfa06 /sys/net | |
parent | 4fc433d8be1f9b634038dc43cb4b9610f7b8476e (diff) | |
download | FreeBSD-src-c61e7755271e1ceb08f1f727231ea9a16676178e.zip FreeBSD-src-c61e7755271e1ceb08f1f727231ea9a16676178e.tar.gz |
Fix a panic in softclock() if the interface is destroyed with a bpf consumer
attached.
This is caused by bpf_detachd clearing IFF_PROMISC on the interface which does
a SIOCSIFFLAGS ioctl. The problem here is that while the interface has been
stopped, IFF_UP has not been cleared so IFF_UP != IFF_DRV_RUNNING, this causes
the ioctl function to init() the interface which resets the callouts.
The destroy then completes and frees the softc but softclock will panic on a
dead callout pointer.
Ensure ifp->if_flags matches reality by clearing IFF_UP when we destroy.
Silence from: rwatson
Approved by: mlaier (mentor)
MFC after: 3 days
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_bridge.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 7b53875..1b68d19 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -492,6 +492,7 @@ bridge_clone_destroy(struct ifnet *ifp) BRIDGE_LOCK(sc); bridge_stop(ifp, 1); + ifp->if_flags &= ~IFF_UP; while ((bif = LIST_FIRST(&sc->sc_iflist)) != NULL) bridge_delete_member(sc, bif); |