Fix scan rescheduling from wpas_stop_pno to check postponed case

Commit 02e122a995 ('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>
This commit is contained in:
Jouni Malinen 2016-03-03 11:04:38 +02:00 committed by Jouni Malinen
parent 29b508e7dc
commit bef5e9a862

View file

@ -3927,7 +3927,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
case EVENT_SCHED_SCAN_STOPPED: case EVENT_SCHED_SCAN_STOPPED:
wpa_s->pno = 0; wpa_s->pno = 0;
wpa_s->sched_scanning = 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); wpa_supplicant_notify_scanning(wpa_s, 0);
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED)