]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix P2P-GROUP-STARTED event for p2p_connect-join
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 4 Feb 2013 13:52:53 +0000 (15:52 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 4 Feb 2013 13:52:53 +0000 (15:52 +0200)
Commit 50178335bff450829729c91c8af798a1d3a7b408 introduced a regression
for P2P-GROUP-STARTED event indication during p2p_connect-join when
using a separate P2P group interface. wpa_s->global->p2p_group_formation
was already set in that case to point to the group interface and this
commit changed this to point to incorrect interface. Fix this by setting
p2p_group_formation here only in case a separate group interface is not
used.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/p2p_supplicant.c

index 0a09b004238c46a9fb8a570d6f7c6c19400f4c62..b7555458474b6a897bf6d1f8aaf2c8e293595727 100644 (file)
@@ -3492,10 +3492,18 @@ static int wpas_p2p_join_start(struct wpa_supplicant *wpa_s)
                os_memcpy(group->p2p_pin, wpa_s->p2p_pin,
                          sizeof(group->p2p_pin));
                group->p2p_wps_method = wpa_s->p2p_wps_method;
+       } else {
+               /*
+                * Need to mark the current interface for p2p_group_formation
+                * when a separate group interface is not used. This is needed
+                * to allow p2p_cancel stop a pending p2p_connect-join.
+                * wpas_p2p_init_group_interface() addresses this for the case
+                * where a separate group interface is used.
+                */
+               wpa_s->global->p2p_group_formation = wpa_s;
        }
 
        group->p2p_in_provisioning = 1;
-       wpa_s->global->p2p_group_formation = wpa_s;
        group->p2p_fallback_to_go_neg = wpa_s->p2p_fallback_to_go_neg;
 
        os_memset(&res, 0, sizeof(res));