Restore scan_req if sta scan is rescheduled in the scan results event

On scan results event if a concurrent P2P scan was triggered previously,
scan results processing is canceled, p2p_find executed, and a new sta
scan is triggered (pending scan). However, this new sta scan does not
restore the scan_req value of the previous scan (whose scan result has
been canceled).

If we are currently connected to an AP and use ap_scan=2, the new
triggered scan will cause an associtation-without-scan in
wpa_supplicant_scan:
(ap_scan == 2 & scan_req != MANUAL_SCAN_REQ)
	=> wpa_supplicant_assoc_try()
causing an association error and a disconnection.

This patch fixes this issue by restoring the previous scan_req value.

Signed-off-by: Loic Poulain <loicx.poulain@intel.com>
This commit is contained in:
Loic Poulain 2013-05-31 12:15:56 +02:00 committed by Jouni Malinen
parent bdec7ee5c9
commit 1245503188
3 changed files with 10 additions and 7 deletions

View file

@ -463,7 +463,7 @@ struct wpa_supplicant {
* to be run.
*/
MANUAL_SCAN_REQ
} scan_req;
} scan_req, last_scan_req;
struct os_time scan_trigger_time;
int scan_runs; /* number of scan runs since WPS was started */
int *next_scan_freqs;