Fix ENABLE_NETWORK not to reconnect in disconnected state (DO NOT MERGE)
DISCONNECT followed by ENABLE_NETWORK ended up starting a scan for a new
connection due to wpa_supplicant_enable_one_network() setting
wpa_s->reassociate = 1. This was done regardless of wpa_s->disconnected
being 1 which should imply that wpa_supplicant should not try to connect
before asked explicitly with REASSOCIATE or RECONNECT.
Fix this by making ENABLE_NETWORK setting of reassociate = 1 and
starting of scans for connection conditional on wpa_s->disconnected ==
0. This will make ENABLE_NETWORK trigger a connection only if
wpa_supplicant is already in a state where it would try to connect if
there are any enabled networks.
Bug: 10483405
Change-Id: Iae606745270f6f3185d5705947f8ccd46bc3a904
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 9ae898b..b431662 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1800,7 +1800,7 @@
* Try to reassociate since there is no current configuration and a new
* network was made available.
*/
- if (!wpa_s->current_ssid)
+ if (!wpa_s->current_ssid && !wpa_s->disconnected)
wpa_s->reassociate = 1;
}
@@ -1821,7 +1821,7 @@
} else
wpa_supplicant_enable_one_network(wpa_s, ssid);
- if (wpa_s->reassociate) {
+ if (wpa_s->reassociate && !wpa_s->disconnected) {
if (wpa_s->sched_scanning) {
wpa_printf(MSG_DEBUG, "Stop ongoing sched_scan to add "
"new network to scan filters");