From 408b2a5625848580d505223cee12d09cbeba10c4 Mon Sep 17 00:00:00 2001 From: Andrei Otcheretianski Date: Mon, 22 May 2023 22:33:46 +0300 Subject: [PATCH] AP: MLO: Add Multi-Link element to (Re)Association Response frame Add the full station profile to the Multi-Link element in the (Re)Association Response frame. In addition, use the AP MLD's MLD MAC address as SA/BSSID once the non-AP MLD has been added to the driver to use address translation in the driver. Signed-off-by: Ilan Peer Signed-off-by: Andrei Otcheretianski --- src/ap/ieee802_11.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 335fa471d..5143bd5ee 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -4663,6 +4663,7 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta, struct ieee80211_mgmt *reply; u8 *p; u16 res = WLAN_STATUS_SUCCESS; + const u8 *sa = hapd->own_addr; buflen = sizeof(struct ieee80211_mgmt) + 1024; #ifdef CONFIG_FILS @@ -4698,9 +4699,19 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta, IEEE80211_FC(WLAN_FC_TYPE_MGMT, (reassoc ? WLAN_FC_STYPE_REASSOC_RESP : WLAN_FC_STYPE_ASSOC_RESP)); + +#ifdef CONFIG_IEEE80211BE + /* + * Once a non-AP MLD is added to the driver, the addressing should use + * MLD MAC address. + */ + if (hapd->conf->mld_ap && sta && sta->mld_info.mld_sta) + sa = hapd->mld_addr; +#endif /* CONFIG_IEEE80211BE */ + os_memcpy(reply->da, addr, ETH_ALEN); - os_memcpy(reply->sa, hapd->own_addr, ETH_ALEN); - os_memcpy(reply->bssid, hapd->own_addr, ETH_ALEN); + os_memcpy(reply->sa, sa, ETH_ALEN); + os_memcpy(reply->bssid, sa, ETH_ALEN); send_len = IEEE80211_HDRLEN; send_len += sizeof(reply->u.assoc_resp); @@ -4836,6 +4847,8 @@ rsnxe_done: #ifdef CONFIG_IEEE80211BE if (hapd->iconf->ieee80211be && !hapd->conf->disable_11be) { + if (hapd->conf->mld_ap) + p = hostapd_eid_eht_basic_ml(hapd, p, sta, false); p = hostapd_eid_eht_capab(hapd, p, IEEE80211_MODE_AP); p = hostapd_eid_eht_operation(hapd, p); }