aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2015-12-10 10:56:04 (GMT)
committerJouni Malinen <j@w1.fi>2015-12-17 22:24:52 (GMT)
commit706e11a485cef327c4de884664b8e72c8a1e6913 (patch)
treec8bf57994842238434e292b096a7f1af6c85409e /wpa_supplicant/events.c
parent819ad5b70b0cb2d3ed64c11aa4cbf11c9a3fc698 (diff)
downloadhostap-706e11a485cef327c4de884664b8e72c8a1e6913.zip
hostap-706e11a485cef327c4de884664b8e72c8a1e6913.tar.gz
hostap-706e11a485cef327c4de884664b8e72c8a1e6913.tar.bz2
Avoid network selection from scan during connection
If scan results arrive during the connection process, the network selection function was called, interrupting the current connection. While a regular scan is mutually exclusive with connection establishment via the nature of radio work, there's no such protection for scheduled scan. Prevent network selection while a connection is in progress. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 3ca4c3f..a7b053d 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1518,6 +1518,10 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
wpas_wps_update_ap_info(wpa_s, scan_res);
+ if (wpa_s->wpa_state >= WPA_AUTHENTICATING &&
+ wpa_s->wpa_state < WPA_COMPLETED)
+ goto scan_work_done;
+
wpa_scan_results_free(scan_res);
if (own_request && wpa_s->scan_work) {