aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2016-02-29 12:30:01 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-03 15:10:26 (GMT)
commit1446afc86579a3340fde2e6c827f804037183e82 (patch)
tree01cd53d5c5f7b00c5cfb4c8be9587e3bfeabdd4f /wpa_supplicant/events.c
parentd14e63a2aaa0ad3275053ffed7cdbd469a937358 (diff)
downloadhostap-1446afc86579a3340fde2e6c827f804037183e82.zip
hostap-1446afc86579a3340fde2e6c827f804037183e82.tar.gz
hostap-1446afc86579a3340fde2e6c827f804037183e82.tar.bz2
wpa_supplicant: Handle EVENT_SCAN_RESULTS when an interface is disabled
An interface can be disabled while it has an ongoing scan request. In such a case, when the scan results notification is received, it was being ignored (as the interface is already disabled) so the scan state was not cleared. This can cause undetermined behavior for the next scan request. To handle this, clear the scan state when EVENT_SCAN_RESULTS is received and the interface is disabled. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index db00515..c39315d 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3343,6 +3343,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED &&
event != EVENT_INTERFACE_ENABLED &&
event != EVENT_INTERFACE_STATUS &&
+ event != EVENT_SCAN_RESULTS &&
event != EVENT_SCHED_SCAN_STOPPED) {
wpa_dbg(wpa_s, MSG_DEBUG,
"Ignore event %s (%d) while interface is disabled",
@@ -3429,6 +3430,14 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
}
break;
case EVENT_SCAN_RESULTS:
+ if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
+ wpa_s->scan_res_handler = NULL;
+ wpa_s->own_scan_running = 0;
+ wpa_s->radio->external_scan_running = 0;
+ wpa_s->last_scan_req = NORMAL_SCAN_REQ;
+ break;
+ }
+
if (!(data && data->scan_info.external_scan) &&
os_reltime_initialized(&wpa_s->scan_start_time)) {
struct os_reltime now, diff;