blob: 06f48b15d7035c5ef445eb01b651877d29a52f04 [file] [log] [blame]
From 699ee38bca47b22ee46e560587a3a0a5630075f3 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Mon, 25 Mar 2024 16:26:34 +0800
Subject: [PATCH 61/89] mtk: mac80211: assign link address to the header of
broadcast mgmt
AAD calculation should use link addr as input for broadcast mgmt. skb.
This commit assigns link address to the header of cloned broadcast mgmt.
for the correct AAD calculation.
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
---
net/mac80211/offchannel.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index dd3ebee..9e4f26a 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -1024,16 +1024,26 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
if (is_multicast_ether_addr(mgmt->da) && hweight16(links) > 1) {
unsigned int link;
struct sk_buff *dskb;
+ struct ieee80211_hdr *hdr;
+ struct ieee80211_bss_conf *conf;
for_each_set_bit(link, &links, IEEE80211_MLD_MAX_NUM_LINKS) {
+ conf = rcu_dereference(sdata->vif.link_conf[link]);
+ if (!conf)
+ continue;
+
dskb = skb_clone(skb, GFP_ATOMIC);
- if (dskb) {
- ieee80211_tx_skb_tid(sdata, dskb, 7, link);
- } else {
+ if (!dskb) {
ret = -ENOMEM;
kfree_skb(skb);
goto out_unlock;
}
+
+ /* Assign link address */
+ hdr = (void *)dskb->data;
+ memcpy(hdr->addr2, conf->addr, ETH_ALEN);
+ memcpy(hdr->addr3, conf->addr, ETH_ALEN);
+ ieee80211_tx_skb_tid(sdata, dskb, 7, link);
}
kfree_skb(skb);
} else {
--
2.18.0