]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Call wpas_connection_failed() only if actually trying to connect
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 1 Dec 2011 16:22:56 +0000 (18:22 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 1 Dec 2011 16:22:56 +0000 (18:22 +0200)
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 <jouni@qca.qualcomm.com>

wpa_supplicant/events.c

index 82639d33ab21971917214068d38df37e97cd68d1..f062d0a89b610674c38af6ceefbf1f1f881e669a 100644 (file)
@@ -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",