From: Aditya Kumar Singh Date: Fri, 23 May 2025 17:25:44 +0000 (+0530) Subject: AP MLD: Validate mld_ap configuration X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e769d9ba7d6908b25632fe685540f8dd0aef2493;p=thirdparty%2Fhostap.git AP MLD: Validate mld_ap configuration 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 Co-developed-by: Manish Dharanenthiran Signed-off-by: Manish Dharanenthiran --- diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index bbf8a7ba8..5b47f7da0 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -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) {