From: Jouni Malinen Date: Thu, 3 Mar 2016 09:04:38 +0000 (+0200) Subject: Fix scan rescheduling from wpas_stop_pno to check postponed case X-Git-Tag: hostap_2_6~783 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bef5e9a8620128a23c32d4253099b1449d4864aa;p=thirdparty%2Fhostap.git Fix scan rescheduling from wpas_stop_pno to check postponed case 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 --- diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 318aad7a1..db0051589 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -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)