aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2016-09-05 14:32:59 (GMT)
committerJouni Malinen <j@w1.fi>2016-10-02 16:38:57 (GMT)
commit14f34a73031e2878101be473d8416f7c09d37833 (patch)
tree52bf5c2f6b7ad7944c1d00161dff5b7cb8671969 /wpa_supplicant/events.c
parent1ac388633a3639d55ed9aaf91f6cd7863faba40d (diff)
downloadhostap-14f34a73031e2878101be473d8416f7c09d37833.zip
hostap-14f34a73031e2878101be473d8416f7c09d37833.tar.gz
hostap-14f34a73031e2878101be473d8416f7c09d37833.tar.bz2
Continue scanning if sched_scan stops unexpectedly
When scheduled scan stops without the interface request (for example, driver stopped it unexpectedly), start a regular scan to continue scanning for networks and avoid being left with no scan at all. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 018cd5f..abe3b47 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -4066,6 +4066,20 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
break;
/*
+ * If the driver stopped scanning without being requested to,
+ * request a new scan to continue scanning for networks.
+ */
+ if (!wpa_s->sched_scan_stop_req &&
+ wpa_s->wpa_state == WPA_SCANNING) {
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "Restart scanning after unexpected sched_scan stop event");
+ wpa_supplicant_req_scan(wpa_s, 1, 0);
+ break;
+ }
+
+ wpa_s->sched_scan_stop_req = 0;
+
+ /*
* Start a new sched scan to continue searching for more SSIDs
* either if timed out or PNO schedule scan is pending.
*/