blob: 2a098b4b454ba42de96520a664ae50152e2f0786 [file] [log] [blame]
From 0f6fde17638d83518432f95ef7b75f2ef883ff1e 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.
CR-Id: WCNCR00289305
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Change-Id: I2a96ced315780b09f0cfc142f0f09b5f4a9a7312
---
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.39.2