Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Feb 2012 05:40:36 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232097 - head/sys/net80211
Message-ID:  <201202240540.q1O5ea88044193@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Fri Feb 24 05:40:36 2012
New Revision: 232097
URL: http://svn.freebsd.org/changeset/base/232097

Log:
  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.

Modified:
  head/sys/net80211/ieee80211_output.c

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Fri Feb 24 05:39:00 2012	(r232096)
+++ head/sys/net80211/ieee80211_output.c	Fri Feb 24 05:40:36 2012	(r232097)
@@ -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, stru
 	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, stru
 		 */
 		senderr(ENETDOWN);
 	}
+	IFQ_UNLOCK(&ifp->if_snd);
 	vap = ifp->if_softc;
 	/*
 	 * Hand to the 802.3 code if not tagged as



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202240540.q1O5ea88044193>