]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Make sure GO start does not miss connect_without_scan
authorJouni Malinen <j@w1.fi>
Tue, 13 May 2014 23:13:18 +0000 (02:13 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 15 May 2014 13:56:49 +0000 (16:56 +0300)
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>
wpa_supplicant/p2p_supplicant.c

index cd1ff12456c37e88577956f8412fc95b82e7dc11..bbe15d814635410d91ffc6ae73bc68b633f89b8c 100644 (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_ctx = wpa_s;
        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->reassociate = 1;
        wpa_s->disconnected = 0;