From b1cd021e2974bf79d764268f8645f28ffbb7f7f2 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 18 Mar 2013 17:04:23 +0200 Subject: [PATCH] P2P: Re-start P2P operation if station mode scanning is stopped There were couple of code paths that could end up stopping station mode scanning without clearing sta_scan_pending. This could result in P2P search getting stuck waiting for completion of station mode scan which would never show up. Fix this by calling wpas_p2p_continue_after_scan() in cases where station mode scans are stopped. This allows sta_scan_pending to be cleared and P2P search operation continued. Signed-hostap: Jouni Malinen --- wpa_supplicant/scan.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index ce33d0c0b..29a430c97 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -531,12 +531,14 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) { wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - interface disabled"); + wpas_p2p_continue_after_scan(wpa_s); return; } if (wpa_s->disconnected && wpa_s->scan_req == NORMAL_SCAN_REQ) { wpa_dbg(wpa_s, MSG_DEBUG, "Disconnected - do not scan"); wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED); + wpas_p2p_continue_after_scan(wpa_s); return; } @@ -544,9 +546,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) wpa_s->scan_req == NORMAL_SCAN_REQ) { wpa_dbg(wpa_s, MSG_DEBUG, "No enabled networks - do not scan"); wpa_supplicant_set_state(wpa_s, WPA_INACTIVE); -#ifdef CONFIG_P2P - wpa_s->sta_scan_pending = 0; -#endif /* CONFIG_P2P */ + wpas_p2p_continue_after_scan(wpa_s); return; } @@ -1143,6 +1143,7 @@ void wpa_supplicant_cancel_scan(struct wpa_supplicant *wpa_s) { wpa_dbg(wpa_s, MSG_DEBUG, "Cancelling scan request"); eloop_cancel_timeout(wpa_supplicant_scan, wpa_s, NULL); + wpas_p2p_continue_after_scan(wpa_s); }