]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Fix hostapd_is_mld_ap() check
authorHuang Chenming <chenhuan@qti.qualcomm.com>
Sat, 26 Jul 2025 04:19:05 +0000 (09:49 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 22 Aug 2025 12:57:48 +0000 (15:57 +0300)
hostapd_is_mld_ap() added in commit 5f5db9366cde ("AP: MLO: Process
Multi-Link element from (Re)Association Request frame") is used to check
whether there is need to process partner links' Association/Connection/
Authorization.

An issue was found in the previous hostapd_is_mld_ap() logic when the
interface count is larger than one and even when another interface is
not affiliated to the same MLD or is not even affiliated with any MLD,
hostapd_is_mld_ap() still returns true which makes hostapd try to
process an unexisting partner link.

Fix this by enhancing the logic of this helper function by returning
false when no other partner link affiliated with the AP MLD exist.

Signed-off-by: Huang Chenming <chenhuan@qti.qualcomm.com>
src/ap/ieee802_11.c

index 5557b46cec3760609e4ade60937c5be0c3b9671a..4952cc705a7badc261131f5b97e0af0ef5ef01dd 100644 (file)
@@ -4947,6 +4947,8 @@ out:
 
 bool hostapd_is_mld_ap(struct hostapd_data *hapd)
 {
+       struct hostapd_data *bss;
+
        if (!hapd->conf->mld_ap)
                return false;
 
@@ -4954,7 +4956,18 @@ bool hostapd_is_mld_ap(struct hostapd_data *hapd)
            hapd->iface->interfaces->count <= 1)
                return false;
 
-       return true;
+       /*
+        * Checking for interfaces count above is not sufficient as there
+        * could be non-MLD interfaces or MLD interface that are not affiliated
+        * with the same MLD as the currently processing one. So need to check
+        * if other partner links exist for this the same AP MLD.
+        */
+       for_each_mld_link(bss, hapd) {
+               if (bss != hapd)
+                       return true;
+       }
+
+       return false;
 }
 
 #endif /* CONFIG_IEEE80211BE */