]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Stop p2p_find/p2p_listen when Invitation is accepted
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 19 Nov 2010 10:58:03 +0000 (12:58 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 19 Nov 2010 10:58:03 +0000 (12:58 +0200)
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

index 318391b51d86c81eccd46ecf420c08c7e1e42f86..2c1615cf4997415fb7cdd5da1c21dc5880c20090 100644 (file)
@@ -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);