diff options
author | adrian <adrian@FreeBSD.org> | 2012-02-24 05:40:36 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-02-24 05:40:36 +0000 |
commit | 69050fa3183539fba0cb5ca1593b7e80e8359fd5 (patch) | |
tree | 4d3d33e664fca3ef61b85bfcf2f1029edc8fd935 /sys/net80211 | |
parent | b4ec3fe70a1b2d7a45b426fabd9b903e0acf1cdf (diff) | |
download | FreeBSD-src-69050fa3183539fba0cb5ca1593b7e80e8359fd5.zip FreeBSD-src-69050fa3183539fba0cb5ca1593b7e80e8359fd5.tar.gz |
Hold IF_LOCK when manipulating the interface flags.
It doesn't _really_ help all that much, I'll commit something to
sys/net/if.c at some point explaining why, but the lock should be held
when checking/manipulating/branching because of said lock.
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_output.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index f6177d9..ca14c52 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -157,8 +157,10 @@ ieee80211_start(struct ifnet *ifp) "%s: ignore queue, in %s state\n", __func__, ieee80211_state_name[vap->iv_state]); vap->iv_stats.is_tx_badstate++; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; IEEE80211_UNLOCK(ic); + IFQ_LOCK(&ifp->if_snd); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IFQ_UNLOCK(&ifp->if_snd); return; } IEEE80211_UNLOCK(ic); @@ -389,7 +391,9 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, struct ieee80211_frame *wh; int error; + IFQ_LOCK(&ifp->if_snd); if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + IFQ_UNLOCK(&ifp->if_snd); /* * Short-circuit requests if the vap is marked OACTIVE * as this can happen because a packet came down through @@ -400,6 +404,7 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, */ senderr(ENETDOWN); } + IFQ_UNLOCK(&ifp->if_snd); vap = ifp->if_softc; /* * Hand to the 802.3 code if not tagged as |