diff mbox

mac80211: Protect Deauthentication frame when using MFP

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

Commit Message

Jouni Malinen June 11, 2010, 2:44 a.m. UTC
None
diff mbox

Patch

--- wireless-testing.orig/net/mac80211/mlme.c	2010-06-10 18:09:38.000000000 -0700
+++ wireless-testing/net/mac80211/mlme.c	2010-06-10 18:35:20.000000000 -0700
@@ -2292,13 +2292,13 @@  int ieee80211_mgd_deauth(struct ieee8021
 	struct ieee80211_local *local = sdata->local;
 	struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
 	struct ieee80211_work *wk;
-	const u8 *bssid = req->bss->bssid;
+	u8 bssid[ETH_ALEN];
 
 	mutex_lock(&ifmgd->mtx);
 
+	memcpy(bssid, req->bss->bssid, ETH_ALEN);
 	if (ifmgd->associated == req->bss) {
-		bssid = req->bss->bssid;
-		ieee80211_set_disassoc(sdata, true);
+		ieee80211_set_disassoc(sdata, false);
 		mutex_unlock(&ifmgd->mtx);
 	} else {
 		bool not_auth_yet = false;
@@ -2345,6 +2345,8 @@  int ieee80211_mgd_deauth(struct ieee8021
 	ieee80211_send_deauth_disassoc(sdata, bssid, IEEE80211_STYPE_DEAUTH,
 				       req->reason_code, cookie,
 				       !req->local_state_change);
+	if (ifmgd->associated == req->bss)
+		sta_info_destroy_addr(sdata, bssid);
 
 	ieee80211_recalc_idle(sdata->local);