]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix scan rescheduling from wpas_stop_pno to check postponed case
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 3 Mar 2016 09:04:38 +0000 (11:04 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 3 Mar 2016 09:04:38 +0000 (11:04 +0200)
Commit 02e122a995dea947a2ad2c0d85190d709f9128b7 ('Reschedule scan from
wpas_stop_pno if it was postponed') uses wpa_s->scanning as the only
condition for automatically starting a postponed scan request from
EVENT_SCHED_SCAN_STOPPED event handler. However, wpa_s->scanning may be
set for sched_scan and as such, this can result in unexpected extra
scans without there having been any real postponed request.

Make this more accurate by verifying that there really is a pending
request for a scan before speeding up its start.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/events.c

index 318aad7a12c8c5a727e41f2a559bcfc1b2c6fe58..db005158961d87fa07ad776a2206b238e1bbbaad 100644 (file)
@@ -3927,7 +3927,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
        case EVENT_SCHED_SCAN_STOPPED:
                wpa_s->pno = 0;
                wpa_s->sched_scanning = 0;
-               resched = wpa_s->scanning;
+               resched = wpa_s->scanning && wpas_scan_scheduled(wpa_s);
                wpa_supplicant_notify_scanning(wpa_s, 0);
 
                if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED)