]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Clear current_ssid and key_mgmt when disconnected
authorJouni Malinen <j@w1.fi>
Sun, 26 Aug 2012 20:20:41 +0000 (23:20 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 26 Aug 2012 20:35:08 +0000 (23:35 +0300)
This makes wpa_supplicant state somewhat cleaner since the information
from previously used connection is not maintained after getting
disconnected.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c

index 315fc346ce9e3563fdc8947091e53e6f9d7774f6..9f12a16d9f7c21aac06dd1c6172722253f9b2250 100644 (file)
@@ -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;
 }
 
 
index 473416191c2d6de485f429839d225cdbf06d7336..e0b42ed3e2446ddac2b650c6759ca701468b1a08 100644 (file)
@@ -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)