developer | dad89a3 | 2024-04-29 14:17:17 +0800 | [diff] [blame] | 1 | From 26fc78265ac13821bb7d075be2859a1f5896f924 Mon Sep 17 00:00:00 2001 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 2 | From: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Tue, 26 Mar 2024 11:36:35 +0800 |
| 4 | Subject: [PATCH 59/61] mtk: wifi: mt76: mt7996: Do MLD address translation |
| 5 | before STA process BMC mgmt. frame |
| 6 | |
| 7 | In the function ieee80211_prepare_and_rx_handle(), BMC mgmt. frames are |
| 8 | not MLD translated since the AAD calculation needs the header being link |
| 9 | addressed. However, after the AAD calculation, STA processes the mgmt. |
| 10 | frames on an MLD level, and it fails to match the link address in the |
| 11 | header with the self MLD address. |
| 12 | |
| 13 | This commit does MLD address translation again after the AAD calculation |
| 14 | and before STA's mgmt. frames processing. |
| 15 | |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 16 | Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com> |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 17 | --- |
| 18 | net/mac80211/mlme.c | 9 +++++++++ |
| 19 | 1 file changed, 9 insertions(+) |
| 20 | |
| 21 | diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c |
| 22 | index 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 | -- |
developer | dad89a3 | 2024-04-29 14:17:17 +0800 | [diff] [blame] | 42 | 2.18.0 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 43 | |