From: Jouni Malinen Date: Thu, 1 Dec 2011 16:22:56 +0000 (+0200) Subject: Call wpas_connection_failed() only if actually trying to connect X-Git-Tag: aosp-jb-start~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56d24b4ee0e7f9f7a09fb12e20bab2fc0d7e1635;p=thirdparty%2Fhostap.git Call wpas_connection_failed() only if actually trying to connect A disconnection event from the driver may end up getting delivered at a time when wpa_supplicant is not even trying to connect (e.g., during a scan that was already started after WPS provisioning step). In such a case, there is not much point calling wpas_connection_failed() and skipping this avoids confusing attempts of re-starting scanning while the previous scan is still in progress. Signed-hostap: Jouni Malinen --- diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 82639d33a..f062d0a89 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1579,7 +1579,8 @@ static void wpa_supplicant_event_disassoc(struct wpa_supplicant *wpa_s, bssid = wpa_s->bssid; if (is_zero_ether_addr(bssid)) bssid = wpa_s->pending_bssid; - wpas_connection_failed(wpa_s, bssid); + if (wpa_s->wpa_state >= WPA_AUTHENTICATING) + wpas_connection_failed(wpa_s, bssid); wpa_sm_notify_disassoc(wpa_s->wpa); wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_DISCONNECTED "bssid=" MACSTR " reason=%d",