]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Allow new link to be added through control interface
authorChenming Huang <quic_chenhuan@quicinc.com>
Thu, 14 Nov 2024 06:28:59 +0000 (11:58 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 13 Feb 2025 17:07:20 +0000 (19:07 +0200)
AP MLD link is added with the same interface name but current control
interface command "ADD" does not consider tjat AP MLD case yet.

Modify the logic here to support adding a new AP MLD link from the "ADD"
command, too, by adding a new hostapd_iface structure instead of just a
new BSS into the existing structure.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
src/ap/hostapd.c

index 3c5653a41f7aaf813e640705669c474abb9f7fe1..1907a6b623e9e23940fae5847957f6e435d90490 100644 (file)
@@ -3354,6 +3354,7 @@ hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
 {
        struct hostapd_iface *new_iface = NULL, *iface = NULL;
        struct hostapd_data *hapd;
+       struct hostapd_config *conf;
        int k;
        size_t i, bss_idx;
 
@@ -3369,17 +3370,26 @@ hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
 
        wpa_printf(MSG_INFO, "Configuration file: %s (phy %s)%s",
                   config_fname, phy, iface ? "" : " --> new PHY");
+
+       conf = interfaces->config_read_cb(config_fname);
+       if (!conf)
+               return NULL;
+
+#ifdef CONFIG_IEEE80211BE
+       /* AP MLD can be enabled with the same interface name, so even if we
+        * get the interface, we still need to allocate a new hostapd_iface
+        * structure. */
+       if (conf->bss[0]->mld_ap)
+               iface = NULL;
+#endif /* CONFIG_IEEE80211BE */
+
        if (iface) {
-               struct hostapd_config *conf;
                struct hostapd_bss_config **tmp_conf;
                struct hostapd_data **tmp_bss;
                struct hostapd_bss_config *bss;
                const char *ifname;
 
                /* Add new BSS to existing iface */
-               conf = interfaces->config_read_cb(config_fname);
-               if (conf == NULL)
-                       return NULL;
                if (conf->num_bss > 1) {
                        wpa_printf(MSG_ERROR, "Multiple BSSes specified in BSS-config");
                        hostapd_config_free(conf);
@@ -3429,6 +3439,8 @@ hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
                conf->bss[0] = NULL;
                hostapd_config_free(conf);
        } else {
+               hostapd_config_free(conf);
+
                /* Add a new iface with the first BSS */
                new_iface = iface = hostapd_init(interfaces, config_fname);
                if (!iface)