PERFORCE change 139279 for review

Sam Leffler sam at FreeBSD.org
Thu Apr 3 17:44:53 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=139279

Change 139279 by sam at sam_ebb on 2008/04/03 17:44:13

	mark the vap OACTIVE under the com lock to close a race against
	the state machine

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_output.c#46 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_output.c#46 (text+ko) ====

@@ -125,12 +125,18 @@
 	 * for CSA).
 	 */
 	if (vap->iv_state != IEEE80211_S_RUN) {
-		IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
-		    "%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;
-		return;
+		IEEE80211_LOCK(ic);
+		/* re-check under the com lock to avoid races */
+		if (vap->iv_state != IEEE80211_S_RUN) {
+			IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
+			    "%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);
+			return;
+		}
+		IEEE80211_UNLOCK(ic);
 	}
 	for (;;) {
 		IFQ_DEQUEUE(&ifp->if_snd, m);


More information about the p4-projects mailing list