blob: 7d99fae3805f3477fe71f3d4bf311dbf7180ae21 [file] [log] [blame]
developerdad89a32024-04-29 14:17:17 +08001From 26fc78265ac13821bb7d075be2859a1f5896f924 Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: Michael-CY Lee <michael-cy.lee@mediatek.com>
3Date: Tue, 26 Mar 2024 11:36:35 +0800
4Subject: [PATCH 59/61] mtk: wifi: mt76: mt7996: Do MLD address translation
5 before STA process BMC mgmt. frame
6
7In the function ieee80211_prepare_and_rx_handle(), BMC mgmt. frames are
8not MLD translated since the AAD calculation needs the header being link
9addressed. However, after the AAD calculation, STA processes the mgmt.
10frames on an MLD level, and it fails to match the link address in the
11header with the self MLD address.
12
13This commit does MLD address translation again after the AAD calculation
14and before STA's mgmt. frames processing.
15
developer66e89bc2024-04-23 14:50:01 +080016Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
developer66e89bc2024-04-23 14:50:01 +080017---
18 net/mac80211/mlme.c | 9 +++++++++
19 1 file changed, 9 insertions(+)
20
21diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
22index 2efd98e..e4d5eac 100644
23--- a/net/mac80211/mlme.c
24+++ b/net/mac80211/mlme.c
25@@ -6931,6 +6931,15 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
26 return;
27 }
28
29+ /* Do MLD address translation for Multicast/Broadcast frame. */
30+ if (is_multicast_ether_addr(mgmt->da) && !ieee80211_is_probe_resp(fc) &&
31+ !ieee80211_is_beacon(fc)) {
32+ if (ether_addr_equal(mgmt->sa, link->conf->bssid))
33+ ether_addr_copy(mgmt->sa, sdata->vif.cfg.ap_addr);
34+ if (ether_addr_equal(mgmt->bssid, link->conf->bssid))
35+ ether_addr_copy(mgmt->bssid, sdata->vif.cfg.ap_addr);
36+ }
37+
38 switch (fc & IEEE80211_FCTL_STYPE) {
39 case IEEE80211_STYPE_BEACON:
40 ieee80211_rx_mgmt_beacon(link, (void *)mgmt,
41--
developerdad89a32024-04-29 14:17:17 +0800422.18.0
developer66e89bc2024-04-23 14:50:01 +080043