]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Ignore association events when GO is not active
authorHuang Chenming <chenhuan@qti.qualcomm.com>
Tue, 14 Oct 2025 11:41:33 +0000 (17:11 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 17 Oct 2025 13:48:51 +0000 (16:48 +0300)
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 <chenhuan@qti.qualcomm.com>
src/ap/drv_callbacks.c

index 769d8f32c504670fce0631b14ebd864fd60f8327..3422893f772c108040732f03f05d51c31ec8528f 100644 (file)
@@ -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