From owner-svn-src-head@FreeBSD.ORG Sun Mar 14 01:57:32 2010 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 92DE21065673; Sun, 14 Mar 2010 01:57:32 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 680218FC0C; Sun, 14 Mar 2010 01:57:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2E1vWJs098928; Sun, 14 Mar 2010 01:57:32 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2E1vWI9098924; Sun, 14 Mar 2010 01:57:32 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201003140157.o2E1vWI9098924@svn.freebsd.org> From: Weongyo Jeong Date: Sun, 14 Mar 2010 01:57:32 +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: r205140 - 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: Sun, 14 Mar 2010 01:57:32 -0000 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;