]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Use PASN for joining a group
authorShivani Baranwal <quic_shivbara@quicinc.com>
Wed, 3 Jul 2024 16:41:26 +0000 (22:11 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 24 Oct 2024 10:35:57 +0000 (13:35 +0300)
When joining a P2P2 group, use PASN negotiation instead of the older
design.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
wpa_supplicant/p2p_supplicant.c

index 13e4b4d71171c42154eb7021f1d3dd1f4f3c4197..ce431abf7bacf5e92a6c7bb6d1108c09874f6e71 100644 (file)
@@ -5822,7 +5822,7 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s,
        if (scan_res)
                wpas_p2p_scan_res_handler(wpa_s, scan_res);
 
-       if (wpa_s->p2p_auto_pd) {
+       if (!wpa_s->p2p2 && wpa_s->p2p_auto_pd) {
                int join = wpas_p2p_peer_go(wpa_s,
                                            wpa_s->pending_join_dev_addr);
                if (join == 0 &&
@@ -5863,15 +5863,22 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s,
                return;
        }
 
-       if (wpa_s->p2p_auto_join) {
+       if (wpa_s->p2p2 || wpa_s->p2p_auto_join) {
                int join = wpas_p2p_peer_go(wpa_s,
                                            wpa_s->pending_join_dev_addr);
-               if (join < 0) {
-                       wpa_printf(MSG_DEBUG, "P2P: Peer was not found to be "
-                                  "running a GO -> use GO Negotiation");
-                       wpa_msg_global(wpa_s->p2pdev, MSG_INFO,
-                                      P2P_EVENT_FALLBACK_TO_GO_NEG
-                                      "reason=peer-not-running-GO");
+
+               if (wpa_s->p2p2 || join < 0) {
+                       if (join < 0) {
+                               wpa_printf(MSG_DEBUG,
+                                          "P2P: Peer was not found to be running a GO -> use GO Negotiation");
+                               wpa_msg_global(wpa_s->p2pdev, MSG_INFO,
+                                              P2P_EVENT_FALLBACK_TO_GO_NEG
+                                              "reason=peer-not-running-GO");
+                       }
+
+                       if (wpa_s->p2p2)
+                               wpa_printf(MSG_DEBUG,
+                                          "P2P2: Initiate GO negotiation and provisioning using PASN Authentication");
                        wpas_p2p_connect(wpa_s, wpa_s->pending_join_dev_addr,
                                         wpa_s->p2p_pin, wpa_s->p2p_wps_method,
                                         wpa_s->p2p_persistent_group, 0, 0, 0,