From patchwork Wed May 30 06:32:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: wpa_supplicant: clear bssid state on deauth Date: Tue, 29 May 2012 20:32:48 -0000 From: Arik Nemtsov X-Patchwork-Id: 161869 Message-Id: <1338359568-11869-1-git-send-email-arik@wizery.com> To: hostap@lists.shmoo.com Cc: Arik Nemtsov 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 Signed-hostap: Arik Nemtsov --- 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) {