diff mbox

mac80211: Fix reassociation processing (within ESS roaming)

Message ID 20100228101346.GA8962@jm.kir.nu (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Jouni Malinen Feb. 28, 2010, 10:13 a.m. UTC
None
diff mbox

Patch

--- uml.orig/net/mac80211/mlme.c	2010-02-28 11:22:00.000000000 +0200
+++ uml/net/mac80211/mlme.c	2010-02-28 11:51:28.000000000 +0200
@@ -1893,8 +1893,20 @@  int ieee80211_mgd_assoc(struct ieee80211
 
 	mutex_lock(&ifmgd->mtx);
 	if (ifmgd->associated) {
-		mutex_unlock(&ifmgd->mtx);
-		return -EALREADY;
+		if (!req->prev_bssid ||
+		    memcmp(req->prev_bssid, ifmgd->associated->bssid,
+			   ETH_ALEN)) {
+			/*
+			 * We are already associated and the request was not a
+			 * reassociation request from the current BSS, so
+			 * reject it.
+			 */
+			mutex_unlock(&ifmgd->mtx);
+			return -EALREADY;
+		}
+
+		/* Trying to reassociate - clear previous association state */
+		ieee80211_set_disassoc(sdata);
 	}
 	mutex_unlock(&ifmgd->mtx);