From: Vinay Gannevaram Date: Wed, 16 Apr 2025 19:28:49 +0000 (+0530) Subject: P2P2: Initialize peer PASN data and set P2P2 on P2P PASN auth frame RX X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f72a54028c4aa849b4cbd3cff5de9893c567e51b;p=thirdparty%2Fhostap.git P2P2: Initialize peer PASN data and set P2P2 on P2P PASN auth frame RX During PASN pairing verification, the PASN authentication frame is received without the need for provision discovery. If the pairing initiator's peer entry is removed and added again or the MAC address is randomized, the Authentication frame is discarded because the PASN data is not initialized. Therefore, ensure that the PASN data for the peer is initialized if it is not already present. Also set the P2P2 bool variable to true. Signed-off-by: Vinay Gannevaram --- diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 7d6cb97ab..bd113ee20 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -7265,8 +7265,11 @@ int p2p_pasn_auth_rx(struct p2p_data *p2p, const struct ieee80211_mgmt *mgmt, } if (!dev->pasn) { - p2p_dbg(p2p, "PASN: Uninitialized"); - return -1; + dev->pasn = pasn_data_init(); + if (!dev->pasn) { + p2p_dbg(p2p, "PASN: Uninitialized"); + return -1; + } } pasn = dev->pasn; diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 449c95fc3..73dbd5f22 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -11505,6 +11505,8 @@ int wpas_p2p_pasn_auth_rx(struct wpa_supplicant *wpa_s, if (wpa_s->global->p2p_disabled || !p2p) return -2; + + wpa_s->p2p2 = true; return p2p_pasn_auth_rx(p2p, mgmt, len, freq); }