From d38c7be0f013703639568a690af0394ceece1fca Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 20 Nov 2015 00:45:40 +0200 Subject: [PATCH] Skip SELECT_NETWORK steps only if already connected or connecting 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 --- wpa_supplicant/wpa_supplicant.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 0b9b3f965..e508115df 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -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");