AP: Add configuration option to specify the desired MLD address

Add mld_addr configuration option to set the MLD MAC address.
The already existing bssid configuration option can be used to
control the AP MLD's link addresses.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Manaswini Paluri <quic_mpaluri@quicinc.com>
This commit is contained in:
Ilan Peer 2023-07-25 12:46:57 +05:30 committed by Jouni Malinen
parent 2763d1d97e
commit 763a19286e
4 changed files with 31 additions and 3 deletions

View file

@ -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,

View file

@ -1048,6 +1048,12 @@ wmm_ac_vo_acm=0
# MLD ID - Affiliated MLD ID
#mld_id=1
# AP MLD MAC address
# The configured address will be set as the interface hardware address and used
# as the AP MLD MAC address. If not set, the current interface hardware address
# will be used as the AP MLD MAC address.
#mld_addr=02:03:04:05:06:07
##### IEEE 802.1X-2004 related configuration ##################################
# Require IEEE 802.1X authorization

View file

@ -242,6 +242,15 @@ static int hostapd_driver_init(struct hostapd_iface *iface)
break;
}
params.bssid = b;
#ifdef CONFIG_IEEE80211BE
/*
* Use the configured MLD MAC address as the interface hardware address
* if this AP is a 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 +279,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:

View file

@ -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 MAC address within the AP MLD */
u8 mld_addr[ETH_ALEN];
#endif /* CONFIG_IEEE80211BE */
};