From: Huang Chenming Date: Tue, 14 Oct 2025 11:41:33 +0000 (+0530) Subject: P2P: Ignore association events when GO is not active X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15edb9b3db02511368c3ae526b1dc8fcdc6931ee;p=thirdparty%2Fhostap.git P2P: Ignore association events when GO is not active Address an issue observed in the following scenario: - DUT operating in STA+AP SCC mode on 5200 MHz, with P2P GO initially on 5745 MHz. - Driver PCL restrictions forced GO to switch to 5200 MHz. - hostapd attempted to revert to 5745 MHz, as 5200 MHz was listed in the avoid frequency range reported by the driver. - Driver again enforced SCC on 5200 MHz. - Channel switch triggered from hostapd and driver again and again. - Leftover association events triggered crashes during channel switch failure and group restart. Fix: Add an early check in hostapd_notif_assoc() to ignore association events when the P2P GO instance is not started or has been disabled. Signed-off-by: Huang Chenming --- diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 769d8f32c..3422893f7 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -332,6 +332,14 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, bool updated = false; bool driver_acl; +#ifdef CONFIG_P2P + if (hapd->p2p_group && (!hapd->started || hapd->disabled)) { + wpa_printf(MSG_DEBUG, + "hostapd_notif_assoc: Ignore assoc event - P2P GO not started or disabled"); + return 0; + } +#endif /* CONFIG_P2P */ + if (addr == NULL) { /* * This could potentially happen with unexpected event from the