]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Skip SELECT_NETWORK steps only if already connected or connecting
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 19 Nov 2015 22:45:40 +0000 (00:45 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 19 Nov 2015 22:45:40 +0000 (00:45 +0200)
Commit 2a6f78fbbefc34fec6685d08f46797c4ef4b2a6e ('Do not re-associate on
SELECT_NETWORK to current network') started skipping all SELECT_NETWORK
connection steps if the selected network had already been selected
previously. This happened regardless of whether the connection was
already established. This is not necessarily desirable for all cases
where there is no immediate action to even try to connect (e.g., long
wait for the next scan).

Speed this up by allowing the SELECT_NETWORK operation to get started if
there is no connection or ongoing connection attempt with the selected
network.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/wpa_supplicant.c

index 0b9b3f9654bd091b2c4909e5d6be61518117fd6f..e508115dfa307994165dbf88fd8d394aa1de8150 100644 (file)
@@ -2725,7 +2725,8 @@ void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
                        wpas_notify_network_enabled_changed(wpa_s, other_ssid);
        }
 
-       if (ssid && ssid == wpa_s->current_ssid && wpa_s->current_ssid) {
+       if (ssid && ssid == wpa_s->current_ssid && wpa_s->current_ssid &&
+           wpa_s->wpa_state >= WPA_AUTHENTICATING) {
                /* We are already associated with the selected network */
                wpa_printf(MSG_DEBUG, "Already associated with the "
                           "selected network - do nothing");