From 9d39057c2bb4110df0d72161153cfbb6a0bfd90d Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 19 Nov 2010 12:58:03 +0200 Subject: [PATCH] P2P: Stop p2p_find/p2p_listen when Invitation is accepted When an Invitation to reinvoke a persistent group is accepted, we need to make sure that any pending p2p_find or p2p_listen operation gets stopped to avoid consuming all radio resources doing device discovery while the group is being set up. --- wpa_supplicant/p2p_supplicant.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 318391b51..2c1615cf4 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3174,8 +3174,8 @@ int wpas_p2p_group_add_persistent(struct wpa_supplicant *wpa_s, return 0; } - wpa_s->p2p_long_listen = 0; - eloop_cancel_timeout(wpas_p2p_long_listen_timeout, wpa_s, NULL); + /* Make sure we are not running find during connection establishment */ + wpas_p2p_stop_find(wpa_s); if (ssid->mode == WPAS_MODE_INFRA) return wpas_start_p2p_client(wpa_s, ssid, addr_allocated); @@ -3346,6 +3346,7 @@ void wpas_p2p_stop_find(struct wpa_supplicant *wpa_s) { wpas_p2p_clear_pending_action_tx(wpa_s); wpa_s->p2p_long_listen = 0; + eloop_cancel_timeout(wpas_p2p_long_listen_timeout, wpa_s, NULL); eloop_cancel_timeout(wpas_p2p_join_scan, wpa_s, NULL); p2p_stop_find(wpa_s->global->p2p);