From 0d30cc240fa36905b034dc9676f9d8da0ac18e56 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 26 Aug 2012 23:20:41 +0300 Subject: [PATCH] Clear current_ssid and key_mgmt when disconnected This makes wpa_supplicant state somewhat cleaner since the information from previously used connection is not maintained after getting disconnected. Signed-hostap: Jouni Malinen --- wpa_supplicant/events.c | 2 ++ wpa_supplicant/wpa_supplicant.c | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 315fc346c..9f12a16d9 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -172,6 +172,8 @@ void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s) if (wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt)) eapol_sm_notify_eap_success(wpa_s->eapol, FALSE); wpa_s->ap_ies_from_associnfo = 0; + wpa_s->current_ssid = NULL; + wpa_s->key_mgmt = 0; } diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 473416191..e0b42ed3e 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -1632,10 +1632,8 @@ static void wpa_supplicant_clear_connection(struct wpa_supplicant *wpa_s, struct wpa_ssid *old_ssid; wpa_clear_keys(wpa_s, addr); - wpa_supplicant_mark_disassoc(wpa_s); old_ssid = wpa_s->current_ssid; - wpa_s->current_ssid = NULL; - wpa_s->current_bss = NULL; + wpa_supplicant_mark_disassoc(wpa_s); wpa_sm_set_config(wpa_s->wpa, NULL); eapol_sm_notify_config(wpa_s->eapol, NULL, NULL); if (old_ssid != wpa_s->current_ssid)