From: Jouni Malinen Date: Tue, 13 May 2014 23:13:18 +0000 (+0300) Subject: P2P: Make sure GO start does not miss connect_without_scan X-Git-Tag: hostap_2_2~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e66f78914e015972c997688e1b8c0fdd747fd08;p=thirdparty%2Fhostap.git 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 --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index cd1ff1245..bbe15d814 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -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;