]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: MLO: Add Multi-Link element to (Re)Association Response frame
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Mon, 22 May 2023 19:33:46 +0000 (22:33 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 8 Jun 2023 20:45:15 +0000 (23:45 +0300)
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 <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/ap/ieee802_11.c

index 335fa471d4465c4882a83a7e37d043d8403835ce..5143bd5eed5c03c2d0476d7ef4ae9ed255a78249 100644 (file)
@@ -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);
        }