diff options
author | sam <sam@FreeBSD.org> | 2009-06-02 16:57:27 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-06-02 16:57:27 +0000 |
commit | 879660c80273fd40883038a11364bbc0ec9798ae (patch) | |
tree | bc8bccdfdebb6d3beff014952e931a816c29ce78 /sys/net80211/ieee80211_ioctl.c | |
parent | 0ccb73a32354d200cc7d10de55ff6044370f8d44 (diff) | |
download | FreeBSD-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_ioctl.c')
-rw-r--r-- | sys/net80211/ieee80211_ioctl.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index d40680a..a8762c4 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -3202,29 +3202,14 @@ ieee80211_ioctl_updatemulti(struct ieee80211com *ic) int ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct ieee80211vap *vap; - struct ieee80211com *ic; + struct ieee80211vap *vap = ifp->if_softc; + struct ieee80211com *ic = vap->iv_ic; int error = 0; struct ifreq *ifr; struct ifaddr *ifa; /* XXX */ - vap = ifp->if_softc; - if (vap == NULL) { - /* - * During detach we clear the backpointer in the softc - * so any ioctl request through the ifnet that arrives - * before teardown is ignored/rejected. In particular - * this hack handles destroying a vap used by an app - * like wpa_supplicant that will respond to the vap - * being forced into INIT state by immediately trying - * to force it back up. We can yank this hack if/when - * we can destroy the ifnet before cleaning up vap state. - */ - return ENXIO; - } switch (cmd) { case SIOCSIFFLAGS: - ic = vap->iv_ic; IEEE80211_LOCK(ic); ieee80211_syncifflag_locked(ic, IFF_PROMISC); ieee80211_syncifflag_locked(ic, IFF_ALLMULTI); @@ -3250,7 +3235,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCADDMULTI: case SIOCDELMULTI: - ieee80211_ioctl_updatemulti(vap->iv_ic); + ieee80211_ioctl_updatemulti(ic); break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: |