P2P: Make sure GO start does not miss connect_without_scan

It looks like there was a possible sequence for wpa_s->scan_req to be
MANUAL_SCAN_REQ at the moment a GO is to be started. This could result
in the "Request scan (that will be skipped) to start GO" to actually not
skip the scan and end up stuck waiting for something external to trigger
a scan before the GO could be started. Fix this by clearing
wpa_s->scan_req when deciding to start the GO.

This issue could be hit at least by first enabling autoscan and then
issuing P2P_GROUP_ADD. Other sequences that set wpa_s->scan_req to
MANUAL_SCAN_REQ without going through wpa_supplicant_scan() to clear it
immediately could also have similar effect (and there is even a small
window for the wpa_supplicant_scan() call to happen only after the
P2P_GROUP_ADD command is processed, so this could potentially have
happened even with SCAN + P2P_GROUP_ADD).

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-05-14 02:13:18 +03:00
parent 16dffef1e6
commit 3e66f78914

View File

@ -1351,6 +1351,7 @@ static void wpas_start_wps_go(struct wpa_supplicant *wpa_s,
wpa_s->ap_configured_cb = p2p_go_configured; wpa_s->ap_configured_cb = p2p_go_configured;
wpa_s->ap_configured_cb_ctx = wpa_s; wpa_s->ap_configured_cb_ctx = wpa_s;
wpa_s->ap_configured_cb_data = wpa_s->go_params; wpa_s->ap_configured_cb_data = wpa_s->go_params;
wpa_s->scan_req = NORMAL_SCAN_REQ;
wpa_s->connect_without_scan = ssid; wpa_s->connect_without_scan = ssid;
wpa_s->reassociate = 1; wpa_s->reassociate = 1;
wpa_s->disconnected = 0; wpa_s->disconnected = 0;