summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-06-02 16:57:27 +0000
committersam <sam@FreeBSD.org>2009-06-02 16:57:27 +0000
commit879660c80273fd40883038a11364bbc0ec9798ae (patch)
treebc8bccdfdebb6d3beff014952e931a816c29ce78 /sys/net80211/ieee80211.c
parent0ccb73a32354d200cc7d10de55ff6044370f8d44 (diff)
downloadFreeBSD-src-879660c80273fd40883038a11364bbc0ec9798ae.zip
FreeBSD-src-879660c80273fd40883038a11364bbc0ec9798ae.tar.gz
Remove hack used to deal with ifnet teardown now that if_detach and the
bridge do a better job. o move ether_ifdetach to the top of ieee80211_detach o do not clear if_softc at the top of ieee80211_detach; we no longer need this because we are safeguarded against calls coming back through if_ioctl o simplify the bpf tracker now that we don't null if_softc This also fixes an issue where having a bpf consumer active when a vap is destroyed would cause a crash because bpf referenced free'd memory. Reviewed by: imp
Diffstat (limited to 'sys/net80211/ieee80211.c')
-rw-r--r--sys/net80211/ieee80211.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index c2f0015..b7cca98 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -544,24 +544,10 @@ ieee80211_vap_detach(struct ieee80211vap *vap)
__func__, ieee80211_opmode_name[vap->iv_opmode],
ic->ic_ifp->if_xname);
- IEEE80211_LOCK(ic);
- /* block traffic from above */
- ifp->if_drv_flags |= IFF_DRV_OACTIVE;
- /*
- * Evil hack. Clear the backpointer from the ifnet to the
- * vap so any requests from above will return an error or
- * be ignored. In particular this short-circuits requests
- * by the bridge to turn off promiscuous mode as a result
- * of calling ether_ifdetach.
- */
- ifp->if_softc = NULL;
- /*
- * Stop the vap before detaching the ifnet. Ideally we'd
- * do this in the other order so the ifnet is inaccessible
- * while we cleanup internal state but that is hard.
- */
- ieee80211_stop_locked(vap);
- IEEE80211_UNLOCK(ic);
+ /* NB: bpfdetach is called by ether_ifdetach and claims all taps */
+ ether_ifdetach(ifp);
+
+ ieee80211_stop(vap);
/*
* Flush any deferred vap tasks.
@@ -587,10 +573,6 @@ ieee80211_vap_detach(struct ieee80211vap *vap)
ieee80211_syncifflag_locked(ic, IFF_ALLMULTI);
IEEE80211_UNLOCK(ic);
- /* XXX can't hold com lock */
- /* NB: bpfdetach is called by ether_ifdetach and claims all taps */
- ether_ifdetach(ifp);
-
ifmedia_removeall(&vap->iv_media);
ieee80211_radiotap_vdetach(vap);
OpenPOWER on IntegriCloud