@@ -4776,6 +4776,12 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->mld_ap = !!atoi(pos);
} else if (os_strcmp(buf, "mld_id") == 0) {
bss->mld_id = atoi(pos);
+ } else if (os_strcmp(buf, "mld_addr") == 0) {
+ if (hwaddr_aton(pos, bss->mld_addr)) {
+ wpa_printf(MSG_ERROR,
+ "Line %d: invalid mld_addr", line);
+ return 1;
+ }
#endif /* CONFIG_IEEE80211BE */
} else {
wpa_printf(MSG_ERROR,
@@ -1048,6 +1048,12 @@ wmm_ac_vo_acm=0
# MLD ID - Affiliated MLD ID
#mld_id=1
+# AP MLD ADDRESS - AP MLD MAC address of this AP
+# The configured address will be set as interface hardware address and used as
+# AP MLD MAC address. If not set current interface hardware address will be used
+# as AP MLD MAC address.
+#mld_addr=02:03:04:05:06:07
+
##### IEEE 802.1X-2004 related configuration ##################################
# Require IEEE 802.1X authorization
@@ -242,6 +242,16 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
break;
}
params.bssid = b;
+#ifdef CONFIG_IEEE80211BE
+ /*
+ * Use the configured MLD address as interface hardware address if this
+ * AP is part of an AP MLD.
+ */
+ if (!is_zero_ether_addr(hapd->conf->mld_addr) &&
+ hapd->conf->mld_ap)
+ params.bssid = hapd->conf->mld_addr;
+#endif /* CONFIG_IEEE80211BE */
+
params.ifname = hapd->conf->iface;
params.driver_params = hapd->iconf->driver_params;
params.use_pae_group_addr = hapd->conf->use_pae_group_addr;
@@ -270,14 +280,18 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
#ifdef CONFIG_IEEE80211BE
/*
* This is the first interface added to the AP MLD, so have the
- * interface hardware address be the MLD address and set a link address
- * to this interface.
+ * interface hardware address be the MLD address, while the link address
+ * would be derived from the original interface address if BSSID is not
+ * configured, and otherwise it would be the configured BSSID.
*/
if (hapd->conf->mld_ap) {
os_memcpy(hapd->mld_addr, hapd->own_addr, ETH_ALEN);
- random_mac_addr_keep_oui(hapd->own_addr);
hapd->mld_next_link_id = 0;
hapd->mld_link_id = hapd->mld_next_link_id++;
+ if (!b)
+ random_mac_addr_keep_oui(hapd->own_addr);
+ else
+ os_memcpy(hapd->own_addr, b, ETH_ALEN);
}
setup_mld:
@@ -944,6 +944,9 @@ struct hostapd_bss_config {
/* The MLD ID to which the AP MLD is affiliated with */
u8 mld_id;
+
+ /* The AP's MLD address within the MLD AP */
+ u8 mld_addr[ETH_ALEN];
#endif /* CONFIG_IEEE80211BE */
};