From 3e66f78914e015972c997688e1b8c0fdd747fd08 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 14 May 2014 02:13:18 +0300 Subject: [PATCH] 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 --- wpa_supplicant/p2p_supplicant.c | 1 + 1 file changed, 1 insertion(+) 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;