]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Validate mld_ap configuration
authorAditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Fri, 23 May 2025 17:25:44 +0000 (22:55 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 3 Jun 2025 15:45:32 +0000 (18:45 +0300)
Currently, hostapd tries to access MLO related functions and structures
even when 'ieee80211be' is unset, as 'mld_ap' is set. This is wrong and
at times, it leads to unexpected issues.

Address this by rejecting the configuration when mld_ap is set, while
'ieee80211be' is unset or disable_11be is set.

While at it, clear the mld_ap while disable_11be flag is modified during
configuration validation.

Signed-off-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Co-developed-by: Manish Dharanenthiran <manish.dharanenthiran@oss.qualcomm.com>
Signed-off-by: Manish Dharanenthiran <manish.dharanenthiran@oss.qualcomm.com>
src/ap/ap_config.c

index bbf8a7ba88451c602124951cc848a1b8d30b1e4c..5b47f7da09da8db5851fb42b547d7a02cdc3fc76 100644 (file)
@@ -1485,6 +1485,7 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
 #ifdef CONFIG_IEEE80211BE
        if (full_config && !bss->disable_11be && bss->disable_11ax) {
                bss->disable_11be = true;
+               bss->mld_ap = 0;
                wpa_printf(MSG_INFO,
                           "Disabling IEEE 802.11be as IEEE 802.11ax is disabled for this BSS");
        }
@@ -1495,6 +1496,12 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
                wpa_printf(MSG_INFO,
                           "Enabling beacon protection as IEEE 802.11be is enabled for this BSS");
        }
+
+       if ((!conf->ieee80211be || bss->disable_11be) && bss->mld_ap) {
+               wpa_printf(MSG_INFO,
+                          "Cannot enable mld_ap when IEEE 802.11be is disabled");
+               return -1;
+       }
 #endif /* CONFIG_IEEE80211BE */
 
        if (full_config && bss->ignore_broadcast_ssid && conf->mbssid) {