blob: 7d99fae3805f3477fe71f3d4bf311dbf7180ae21 [file] [log] [blame]
From 26fc78265ac13821bb7d075be2859a1f5896f924 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Tue, 26 Mar 2024 11:36:35 +0800
Subject: [PATCH 59/61] mtk: wifi: mt76: mt7996: Do MLD address translation
before STA process BMC mgmt. frame
In the function ieee80211_prepare_and_rx_handle(), BMC mgmt. frames are
not MLD translated since the AAD calculation needs the header being link
addressed. However, after the AAD calculation, STA processes the mgmt.
frames on an MLD level, and it fails to match the link address in the
header with the self MLD address.
This commit does MLD address translation again after the AAD calculation
and before STA's mgmt. frames processing.
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
---
net/mac80211/mlme.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 2efd98e..e4d5eac 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -6931,6 +6931,15 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
return;
}
+ /* Do MLD address translation for Multicast/Broadcast frame. */
+ if (is_multicast_ether_addr(mgmt->da) && !ieee80211_is_probe_resp(fc) &&
+ !ieee80211_is_beacon(fc)) {
+ if (ether_addr_equal(mgmt->sa, link->conf->bssid))
+ ether_addr_copy(mgmt->sa, sdata->vif.cfg.ap_addr);
+ if (ether_addr_equal(mgmt->bssid, link->conf->bssid))
+ ether_addr_copy(mgmt->bssid, sdata->vif.cfg.ap_addr);
+ }
+
switch (fc & IEEE80211_FCTL_STYPE) {
case IEEE80211_STYPE_BEACON:
ieee80211_rx_mgmt_beacon(link, (void *)mgmt,
--
2.18.0