Reset normal_scans counter upon entering INTERFACE_DISABLED state

Depending on the implementation, the scheduled scan may not give results
quickly when in DISCONNECTED state. This patch resets
wpa_s::normal_scans upon entering to the INTERFACE_DISABLED state so a
normal scan is assured upon going to DISCONNECTED state after the
interface has been re-enabled. This mainly solves a long reconnect time
observed upon repeated kernel driver reloads, i.e., third reload
resulted in a scheduled scan.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-hostap: Arend van Spriel <arend@broadcom.com>
This commit is contained in:
Arend van Spriel 2014-01-15 10:11:32 +01:00 committed by Jouni Malinen
parent 94a2dd0b25
commit 5ddd07cb37

View file

@ -652,6 +652,11 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
wpa_supplicant_state_txt(wpa_s->wpa_state), wpa_supplicant_state_txt(wpa_s->wpa_state),
wpa_supplicant_state_txt(state)); wpa_supplicant_state_txt(state));
if (state == WPA_INTERFACE_DISABLED) {
/* Assure normal scan when interface is restored */
wpa_s->normal_scans = 0;
}
if (state == WPA_COMPLETED) if (state == WPA_COMPLETED)
wpas_connect_work_done(wpa_s); wpas_connect_work_done(wpa_s);