From: Shivani Baranwal Date: Mon, 22 Sep 2025 09:05:39 +0000 (+0530) Subject: P2P2: Use peer listen frequency when initiating PASN authentication X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d66cea8aa90d563e3ecb521fafba688472b9e87c;p=thirdparty%2Fhostap.git P2P2: Use peer listen frequency when initiating PASN authentication 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 --- 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;