path: root/wpa_supplicant/wpa_supplicant.c
diff options
authorJouni Malinen <jouni@qca.qualcomm.com>2015-09-22 08:55:54 (GMT)
committerJouni Malinen <j@w1.fi>2015-09-22 08:55:54 (GMT)
commit5a1d9d1a8ea540f6d79d3a8f8fdf0ed0e2f19e54 (patch)
treef0e189ac3e412404499ef9c51bbb1751a34acebb /wpa_supplicant/wpa_supplicant.c
parentce7d0eb1841ea4ebd5590d7ce2d9ff4d2a91878e (diff)
Avoid reconnection on ENABLE_NETWORK if already connected
This was already the case for most command sequences, but it was possible for wpa_s->reassociate to be set to 1 when CTRL-RSP-* commands were used to set identity, password, or passphrase for EAP authentication. In such cases, ENABLE_NETWORK issued after the connection was completed could result in a new connection attempt (likely reconnection back to the same BSS). Fix this by checking whether an actual connection is already present even if wpa_s->reassociate is set when processing the ENABLE_NETWORK command. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/wpa_supplicant.c')
1 files changed, 4 insertions, 1 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index fa94cc7..acfe95b 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2574,7 +2574,10 @@ void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
} else
wpa_supplicant_enable_one_network(wpa_s, ssid);
- if (wpa_s->reassociate && !wpa_s->disconnected) {
+ if (wpa_s->reassociate && !wpa_s->disconnected &&
+ (!wpa_s->current_ssid ||
+ wpa_s->wpa_state == WPA_DISCONNECTED ||
+ wpa_s->wpa_state == WPA_SCANNING)) {
if (wpa_s->sched_scanning) {
wpa_printf(MSG_DEBUG, "Stop ongoing sched_scan to add "
"new network to scan filters");