Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Mar 2010 01:57:32 +0000 (UTC)
From:      Weongyo Jeong <weongyo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r205140 - head/sys/net80211
Message-ID:  <201003140157.o2E1vWI9098924@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: weongyo
Date: Sun Mar 14 01:57:32 2010
New Revision: 205140
URL: http://svn.freebsd.org/changeset/base/205140

Log:
  fixes a broken software beacon miss handler.  There is a race to check
  vap->iv_bmiss_count == 0 in ieee80211_swbmiss because iv_swbmiss_task is
  enqueued by taskqueue.
  
  Reviewed by:	rpaulo

Modified:
  head/sys/net80211/ieee80211_proto.c
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_tdma.c

Modified: head/sys/net80211/ieee80211_proto.c
==============================================================================
--- head/sys/net80211/ieee80211_proto.c	Sun Mar 14 00:32:18 2010	(r205139)
+++ head/sys/net80211/ieee80211_proto.c	Sun Mar 14 01:57:32 2010	(r205140)
@@ -1432,8 +1432,6 @@ ieee80211_swbmiss(void *arg)
 	} else if (vap->iv_swbmiss_count == 0) {
 		if (vap->iv_bmiss != NULL)
 			ieee80211_runtask(ic, &vap->iv_swbmiss_task);
-		if (vap->iv_bmiss_count == 0)	/* don't re-arm timer */
-			return;
 	} else
 		vap->iv_swbmiss_count = 0;
 	callout_reset(&vap->iv_swbmiss, vap->iv_swbmiss_period,

Modified: head/sys/net80211/ieee80211_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_sta.c	Sun Mar 14 00:32:18 2010	(r205139)
+++ head/sys/net80211/ieee80211_sta.c	Sun Mar 14 01:57:32 2010	(r205140)
@@ -141,6 +141,8 @@ sta_beacon_miss(struct ieee80211vap *vap
 			vap->iv_bss->ni_essid, vap->iv_bss->ni_esslen);
 		return;
 	}
+
+	callout_stop(&vap->iv_swbmiss);
 	vap->iv_bmiss_count = 0;
 	vap->iv_stats.is_beacon_miss++;
 	if (vap->iv_roaming == IEEE80211_ROAMING_AUTO) {

Modified: head/sys/net80211/ieee80211_tdma.c
==============================================================================
--- head/sys/net80211/ieee80211_tdma.c	Sun Mar 14 00:32:18 2010	(r205139)
+++ head/sys/net80211/ieee80211_tdma.c	Sun Mar 14 01:57:32 2010	(r205140)
@@ -295,6 +295,8 @@ tdma_beacon_miss(struct ieee80211vap *va
 		"beacon miss, mode %u state %s\n",
 		vap->iv_opmode, ieee80211_state_name[vap->iv_state]);
 
+	callout_stop(&vap->iv_swbmiss);
+
 	if (ts->tdma_peer != NULL) {	/* XXX? can this be null? */
 		ieee80211_notify_node_leave(vap->iv_bss);
 		ts->tdma_peer = NULL;



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