linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.34] mac80211: Fix auth retries if AP sends temporary deauth
@ 2010-07-01 17:21 Paul Stewart
  2010-07-02 17:21 ` Johannes Berg
  2010-07-02 17:29 ` Johannes Berg
  0 siblings, 2 replies; 8+ messages in thread
From: Paul Stewart @ 2010-07-01 17:21 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Michael Wu, Jiri Benc, John W. Linville

This bypasses destruction of BSS state if a temporary DEAUTH packet is
received while performing an AUTH.  This will allow the retry mechanism
(which runs regardless of this patch) to succeed, since we do not remove
the BSS state which is required to complete authentication on the client
side in cfg80211_send_rx_auth().

The specific case handled here is "Previous authentication no longer
valid", which is usually generated by an AP if the AP still has saved
state of the STA being authenticated.  Usually a retry will be successful.

Signed-off-by: Paul Stewart <pstew@google.com>
---
net/mac80211/work.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 15e1ba9..800929e 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -1006,7 +1006,7 @@ ieee80211_rx_result
ieee80211_work_rx_mgmt(struct ieee80211_sub_if_data *sdata,
 	struct ieee80211_local *local = sdata->local;
 	struct ieee80211_mgmt *mgmt;
 	struct ieee80211_work *wk;
-	u16 fc;
+	u16 fc, reason_code;

 	if (skb->len < 24)
 		return RX_DROP_MONITOR;
@@ -1030,6 +1030,25 @@ ieee80211_rx_result
ieee80211_work_rx_mgmt(struct ieee80211_sub_if_data *sdata,
 			skb_queue_tail(&local->work_skb_queue, skb);
 			ieee80211_queue_work(&local->hw, &local->work_work);
 			return RX_QUEUED;
+		case IEEE80211_STYPE_DEAUTH:
+			/*
+			 * If we get sent a DEAUTH while we are
+			 * actively trying to authenticate to this
+			 * station, we shoot ourselves in the foot if
+			 * we fall through using RX_CONTINUE and allow
+			 * the bss context to disappear
+			 * (ieee80211_sta_rx_mgmt()).  This is
+			 * especially true if the reason for the
+			 * DEAUTH was a negative but temporary direct
+			 * response to an AUTH attempt. Let the retry
+			 * mechanism run its course instead.
+			 */
+                        reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
+			if (wk->type == IEEE80211_WORK_AUTH &&
+                            reason_code == WLAN_REASON_PREV_AUTH_NOT_VALID) {
+				return RX_DROP_MONITOR;
+			}
+			break;
 		}
 	}

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-07-13 15:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-01 17:21 [PATCH 2.6.34] mac80211: Fix auth retries if AP sends temporary deauth Paul Stewart
2010-07-02 17:21 ` Johannes Berg
2010-07-02 17:29 ` Johannes Berg
2010-07-02 18:09   ` Paul Stewart
2010-07-02 18:13     ` Johannes Berg
2010-07-02 19:57       ` Paul Stewart
2010-07-12 12:46         ` [PATCH] cfg80211: ignore spurious deauth Johannes Berg
2010-07-13 15:04           ` Paul Stewart

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).