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.
This commit is contained in:
Adrian Chadd 2012-02-24 05:40:36 +00:00
parent dcc56af073
commit 70e0b5ac20
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232097

View File

@ -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