linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Stewart <pstew@chromium.org>
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net
Subject: [RFC] cfg80211: Fix handling of previous_auth deauth
Date: Mon, 6 Jun 2011 16:00:36 -0700	[thread overview]
Message-ID: <a194a41b3f1376f035113d4f443038eb2e64264f.1307403076.git.pstew@chromium.org> (raw)

The WLAN_REASON_PREV_AUTH_NOT_VALID DEAUTH message is sent
to remove current successful authentications, not to to abort
a new authentication attempts.  Therefore, filter this reason
code out when deciding whether to remove authtry_bsses[] entries.

This is the least invasive change which prevents this issue
from appearing.  It doesn't address the fact that the mac80211
code still retries authentications if it is DEAUTHed for some
other reason during authentication.  If one of those retries
succeeds the client can do nothing with it sicne authtry_bsses[]
has been cleared.

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

diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 493b939..48e965d 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -150,6 +150,7 @@ void __cfg80211_send_deauth(struct net_device *dev,
 	const u8 *bssid = mgmt->bssid;
 	int i;
 	bool found = false, was_current = false;
+	u16 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
 
 	ASSERT_WDEV_LOCK(wdev);
 
@@ -170,7 +171,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 &&
+		    reason_code != WLAN_REASON_PREV_AUTH_NOT_VALID) {
 			cfg80211_unhold_bss(wdev->authtry_bsses[i]);
 			cfg80211_put_bss(&wdev->authtry_bsses[i]->pub);
 			wdev->authtry_bsses[i] = NULL;
@@ -185,11 +188,8 @@ void __cfg80211_send_deauth(struct net_device *dev,
 	nl80211_send_deauth(rdev, dev, buf, len, GFP_KERNEL);
 
 	if (wdev->sme_state == CFG80211_SME_CONNECTED && was_current) {
-		u16 reason_code;
 		bool from_ap;
 
-		reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
-
 		from_ap = memcmp(mgmt->sa, dev->dev_addr, ETH_ALEN) != 0;
 		__cfg80211_disconnected(dev, NULL, 0, reason_code, from_ap);
 	} else if (wdev->sme_state == CFG80211_SME_CONNECTING) {
-- 
1.7.3.1


             reply	other threads:[~2011-06-06 23:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06 23:00 Paul Stewart [this message]
2011-06-08 11:02 ` [RFC] cfg80211: Fix handling of previous_auth deauth Johannes Berg
     [not found]   ` <BANLkTimdAHt9VUUmNB2uzgm8ymeo6J+EeA@mail.gmail.com>
2011-06-08 11:44     ` Johannes Berg
2011-06-08 11:48       ` Paul Stewart
2011-06-08 11:50         ` Johannes Berg
2011-06-08 12:52           ` [PATCH] cfg80211: Ignore downstream DEAUTH for authtry_bsses Paul Stewart
2011-06-08 13:19             ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a194a41b3f1376f035113d4f443038eb2e64264f.1307403076.git.pstew@chromium.org \
    --to=pstew@chromium.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).