diff mbox

cfg80211: Ignore downstream DEAUTH for authtry_bsses

Message ID 20110608131433.DC6B62034B@glenhelen.mtv.corp.google.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Paul Stewart June 8, 2011, 12:52 p.m. UTC
Downsteram DEAUTH messages do not refer to a current authentication
attempt -- AUTH responses do.  Therefore we should not allow DEAUTH
from an AP to void state for an AUTH attempt in progress.

Signed-off-by: Paul Stewart <pstew@chromium.org>
---
 net/wireless/mlme.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Johannes Berg June 8, 2011, 1:19 p.m. UTC | #1
On Wed, 2011-06-08 at 05:52 -0700, Paul Stewart wrote:
> Downsteram DEAUTH messages do not refer to a current authentication
> attempt -- AUTH responses do.  Therefore we should not allow DEAUTH
> from an AP to void state for an AUTH attempt in progress.

Could you reproduce the original problem? This looks nice.

> Signed-off-by: Paul Stewart <pstew@chromium.org>
> ---
>  net/wireless/mlme.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
> index 493b939..3633ab6 100644
> --- a/net/wireless/mlme.c
> +++ b/net/wireless/mlme.c
> @@ -170,7 +170,9 @@ void __cfg80211_send_deauth(struct net_device *dev,
>  			break;
>  		}
>  		if (wdev->authtry_bsses[i] &&
> -		    memcmp(wdev->authtry_bsses[i]->pub.bssid, bssid, ETH_ALEN) == 0) {
> +		    memcmp(wdev->authtry_bsses[i]->pub.bssid, bssid,
> +			   ETH_ALEN) == 0 &&
> +		    memcmp(mgmt->sa, dev->dev_addr, ETH_ALEN) == 0) {
>  			cfg80211_unhold_bss(wdev->authtry_bsses[i]);
>  			cfg80211_put_bss(&wdev->authtry_bsses[i]->pub);
>  			wdev->authtry_bsses[i] = NULL;


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 493b939..3633ab6 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -170,7 +170,9 @@  void __cfg80211_send_deauth(struct net_device *dev,
 			break;
 		}
 		if (wdev->authtry_bsses[i] &&
-		    memcmp(wdev->authtry_bsses[i]->pub.bssid, bssid, ETH_ALEN) == 0) {
+		    memcmp(wdev->authtry_bsses[i]->pub.bssid, bssid,
+			   ETH_ALEN) == 0 &&
+		    memcmp(mgmt->sa, dev->dev_addr, ETH_ALEN) == 0) {
 			cfg80211_unhold_bss(wdev->authtry_bsses[i]);
 			cfg80211_put_bss(&wdev->authtry_bsses[i]->pub);
 			wdev->authtry_bsses[i] = NULL;