[PATCH] wpa_supplicant: clear bssid state on deauth

Arik Nemtsov arik
Tue May 29 23:32:48 PDT 2012


When de-authenticated by an AP, the state of wpa_s should be cleared,
especially the previous bssid. Otherwise, we will use re-assoc packets
when associating to the same AP. This is not according to spec, and some
APs refuse to association.

Reported-by: Yossi Wortzel <yossiw at ti.com>
Signed-hostap: Arik Nemtsov <arik at wizery.com>
---
I'm not 100% sure with this patch, I just tried to copy the relevant
parts from sme_deauth(). But it definitely fixed some real world issues
we encountered with a mac80211 based driver. With prev_bssid_set == 1,
re-assoc packets are used in mac80211 during association.

 wpa_supplicant/events.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index d09be6c..b8b25f6 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2246,6 +2246,18 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 					    data->deauth_info.ie,
 					    data->deauth_info.ie_len);
 			}
+
+#ifdef CONFIG_AP
+			if (wpa_s->ap_iface == NULL)
+#endif /* CONFIG_AP */
+			{
+#ifdef CONFIG_SME
+				wpa_s->sme.prev_bssid_set = 0;
+#endif /* CONFIG_SME */
+				wpa_supplicant_set_state(wpa_s,
+							 WPA_DISCONNECTED);
+				os_memset(wpa_s->bssid, 0, ETH_ALEN);
+			}
 		}
 #ifdef CONFIG_AP
 		if (wpa_s->ap_iface && data && data->deauth_info.addr) {
-- 
1.7.9.5




More information about the Hostap mailing list