From: Chenming Huang Date: Thu, 14 Nov 2024 06:28:59 +0000 (+0530) Subject: AP MLD: Allow new link to be added through control interface X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab3791d91db7280eea790b5586a5b43064daee12;p=thirdparty%2Fhostap.git AP MLD: Allow new link to be added through control interface 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 --- diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 3c5653a41..1907a6b62 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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)