From 83df8149463fe6e9ddf056b092f2d1907c073b53 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 23 Mar 2012 16:12:07 -0700 Subject: [PATCH] Clear previous BSSID on explicit disconnection request There is no need to use reassociation instead of association in a case the previous connection was explicitly disconnected. Signed-hostap: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 20ce8c1df..270bf8c9e 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -1757,6 +1757,9 @@ static int wpa_supplicant_ctrl_iface_remove_network( } eapol_sm_invalidate_cached_session(wpa_s->eapol); if (wpa_s->current_ssid) { +#ifdef CONFIG_SME + wpa_s->sme.prev_bssid_set = 0; +#endif /* CONFIG_SME */ wpa_sm_set_config(wpa_s->wpa, NULL); eapol_sm_notify_config(wpa_s->eapol, NULL, NULL); wpa_supplicant_disassociate(wpa_s, @@ -1779,6 +1782,9 @@ static int wpa_supplicant_ctrl_iface_remove_network( } if (ssid == wpa_s->current_ssid || wpa_s->current_ssid == NULL) { +#ifdef CONFIG_SME + wpa_s->sme.prev_bssid_set = 0; +#endif /* CONFIG_SME */ /* * Invalidate the EAP session cache if the current or * previously used network is removed. @@ -3938,6 +3944,9 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, reply_len = wpa_supplicant_ctrl_iface_list_networks( wpa_s, reply, reply_size); } else if (os_strcmp(buf, "DISCONNECT") == 0) { +#ifdef CONFIG_SME + wpa_s->sme.prev_bssid_set = 0; +#endif /* CONFIG_SME */ wpa_s->reassociate = 0; wpa_s->disconnected = 1; wpa_supplicant_cancel_sched_scan(wpa_s);