From owner-svn-src-head@FreeBSD.ORG Fri Feb 24 05:40:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C54D41065675; Fri, 24 Feb 2012 05:40:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B49A78FC13; Fri, 24 Feb 2012 05:40:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1O5eauN044195; Fri, 24 Feb 2012 05:40:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1O5ea88044193; Fri, 24 Feb 2012 05:40:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202240540.q1O5ea88044193@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Feb 2012 05:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232097 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2012 05:40:36 -0000 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