From d66cea8aa90d563e3ecb521fafba688472b9e87c Mon Sep 17 00:00:00 2001 From: Shivani Baranwal Date: Mon, 22 Sep 2025 14:35:39 +0530 Subject: [PATCH] P2P2: Use peer listen frequency when initiating PASN authentication MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit While initiating PASN authentication during P2P connect, use the peer’s listen frequency instead of the previously used force_freq. The force_freq is intended to be used as operating channel for the P2P group formation, it may not match the peer’s current listen channel and can lead to off-channel PASN attempts. Signed-off-by: Shivani Baranwal --- wpa_supplicant/p2p_supplicant.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 5db5eb915..da9d9bd41 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -7185,8 +7185,12 @@ int wpas_p2p_connect(struct wpa_supplicant *wpa_s, const u8 *peer_addr, } #ifdef CONFIG_PASN - if (wpa_s->p2p2 && !wpa_s->p2p_pd_before_go_neg) - wpas_p2p_initiate_pasn_auth(wpa_s, peer_addr, force_freq); + if (wpa_s->p2p2 && !wpa_s->p2p_pd_before_go_neg) { + int listen_freq = p2p_get_listen_freq(wpa_s->global->p2p, + peer_addr); + + wpas_p2p_initiate_pasn_auth(wpa_s, peer_addr, listen_freq); + } #endif /* CONFIG_PASN */ return ret; -- 2.47.3