diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 062c696d0..ae05a37e3 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1395,6 +1395,16 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s, return 1; } #endif /* CONFIG_INTERWORKING */ +#ifdef CONFIG_WPS + if (wpa_s->after_wps > 0) { + wpa_dbg(wpa_s, MSG_DEBUG, "Use shorter wait during WPS processing"); + timeout_sec = 0; + timeout_usec = 500000; + wpa_supplicant_req_new_scan(wpa_s, timeout_sec, + timeout_usec); + return 0; + } +#endif /* CONFIG_WPS */ if (wpa_supplicant_req_sched_scan(wpa_s)) wpa_supplicant_req_new_scan(wpa_s, timeout_sec, timeout_usec); diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 899d2a99a..372685718 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -299,7 +299,8 @@ static void wpa_supplicant_optimize_freqs( if (params->freqs) params->freqs[0] = wpa_s->wps_freq; wpa_s->after_wps--; - } + } else if (wpa_s->after_wps) + wpa_s->after_wps--; if (params->freqs == NULL && wpa_s->known_wps_freq && wpa_s->wps_freq) {