From nobody@FreeBSD.org  Tue Feb 28 02:38:39 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 31F521065670
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Feb 2012 02:38:39 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 158D48FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Feb 2012 02:38:39 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q1S2cc2j022574
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Feb 2012 02:38:38 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q1S2ccfU022573;
	Tue, 28 Feb 2012 02:38:38 GMT
	(envelope-from nobody)
Message-Id: <201202280238.q1S2ccfU022573@red.freebsd.org>
Date: Tue, 28 Feb 2012 02:38:38 GMT
From: Adrian Chadd <adrian@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [net80211] bgscan isn't triggered when invalid beacons are being sent
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         165517
>Category:       kern
>Synopsis:       [net80211] bgscan isn't triggered when invalid beacons are being sent
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-wireless
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 28 02:40:07 UTC 2012
>Closed-Date:    
>Last-Modified:  Tue Feb 28 04:10:11 UTC 2012
>Originator:     Adrian Chadd
>Release:        -CURRENT
>Organization:
>Environment:
9.0-RELEASE with HEAD net80211/ath
>Description:
I was trying to figure out why bgscan isn't working in some instances.

What's happening is this:

* the bgscan is triggered via sta_recv_mgmt(), on a valid beacon frame
* but if the beacon frame isn't valid, it fails an earlier check, so the ieee80211_bg_scan() call is never made.

>How-To-Repeat:
Find an AP whose beacons fail the check.
>Fix:
* Fix ieee80211_parse_beacon() if it needs to be fixed
* potentially ignore the beacon contents _but_ still trigger a background scan if possible.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-wireless 
Responsible-Changed-By: adrian 
Responsible-Changed-When: Tue Feb 28 02:42:25 UTC 2012 
Responsible-Changed-Why:  
Reassign 


http://www.freebsd.org/cgi/query-pr.cgi?pr=165517 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/165517: commit references a PR
Date: Tue, 28 Feb 2012 04:05:51 +0000 (UTC)

 Author: adrian
 Date: Tue Feb 28 04:05:35 2012
 New Revision: 232244
 URL: http://svn.freebsd.org/changeset/base/232244
 
 Log:
   Track the number of bad beacons received.
   
   PR:		kern/165517
 
 Modified:
   head/sys/net80211/ieee80211_ioctl.h
   head/sys/net80211/ieee80211_sta.c
 
 Modified: head/sys/net80211/ieee80211_ioctl.h
 ==============================================================================
 --- head/sys/net80211/ieee80211_ioctl.h	Tue Feb 28 03:11:02 2012	(r232243)
 +++ head/sys/net80211/ieee80211_ioctl.h	Tue Feb 28 04:05:35 2012	(r232244)
 @@ -241,8 +241,9 @@ struct ieee80211_stats {
  	uint32_t	is_mesh_notproxy;	/* dropped 'cuz not proxying */
  	uint32_t	is_rx_badalign;		/* dropped 'cuz misaligned */
  	uint32_t	is_hwmp_proxy;		/* PREP for proxy route */
 +	uint32_t	is_beacon_bad;		/* Number of bad beacons */
  	
 -	uint32_t	is_spare[11];
 +	uint32_t	is_spare[10];
  };
  
  /*
 
 Modified: head/sys/net80211/ieee80211_sta.c
 ==============================================================================
 --- head/sys/net80211/ieee80211_sta.c	Tue Feb 28 03:11:02 2012	(r232243)
 +++ head/sys/net80211/ieee80211_sta.c	Tue Feb 28 04:05:35 2012	(r232244)
 @@ -1305,8 +1305,10 @@ sta_recv_mgmt(struct ieee80211_node *ni,
  			return;
  		}
  		/* XXX probe response in sta mode when !scanning? */
 -		if (ieee80211_parse_beacon(ni, m0, &scan) != 0)
 +		if (ieee80211_parse_beacon(ni, m0, &scan) != 0) {
 +			vap->iv_stats.is_beacon_bad++;
  			return;
 +		}
  		/*
  		 * Count frame now that we know it's to be processed.
  		 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/165517: commit references a PR
Date: Tue, 28 Feb 2012 04:06:52 +0000 (UTC)

 Author: adrian
 Date: Tue Feb 28 04:06:42 2012
 New Revision: 232245
 URL: http://svn.freebsd.org/changeset/base/232245
 
 Log:
   Add is_beacon_bad.
   
   PR:		kern/165517
 
 Modified:
   head/tools/tools/net80211/wlanstats/wlanstats.c
 
 Modified: head/tools/tools/net80211/wlanstats/wlanstats.c
 ==============================================================================
 --- head/tools/tools/net80211/wlanstats/wlanstats.c	Tue Feb 28 04:05:35 2012	(r232244)
 +++ head/tools/tools/net80211/wlanstats/wlanstats.c	Tue Feb 28 04:06:42 2012	(r232245)
 @@ -370,6 +370,8 @@ static const struct fmt wlanstats[] = {
  	{ 5,	"noise",	"noise",	"current noise floor (dBm)" },
  #define	S_SIGNAL		AFTER(S_NOISE)
  	{ 5,	"signal",	"sig",		"current signal (dBm)" },
 +#define	S_BEACON_BAD		AFTER(S_SIGNAL)
 +	{ 9,	"beacon_bad",	"beaconbad",	"bad beacons received" },
  };
  
  struct wlanstatfoo_p {
 @@ -814,6 +816,7 @@ wlan_get_curstat(struct statfoo *sf, int
  	case S_RX_MCAST:	NSTAT(rx_mcast);
  	case S_TX_UCAST:	NSTAT(tx_ucast);
  	case S_TX_MCAST:	NSTAT(tx_mcast);
 +	case S_BEACON_BAD:	STAT(beacon_bad);
  	}
  	return wlan_getinfo(wf, s, b, bs);
  #undef NSTAT
 @@ -972,6 +975,7 @@ wlan_get_totstat(struct statfoo *sf, int
  	case S_RX_MCAST:	NSTAT(rx_mcast);
  	case S_TX_UCAST:	NSTAT(tx_ucast);
  	case S_TX_MCAST:	NSTAT(tx_mcast);
 +	case S_BEACON_BAD:	STAT(beacon_bad);
  	}
  	return wlan_getinfo(wf, s, b, bs);
  #undef NSTAT
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
