blob: 26c07c3ccc8524826a4f68e2370a615ec6a90d70 [file] [log] [blame]
From 06d3d93fc257b9f8cef083b9b84711fc9c3cee19 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Wed, 21 Feb 2024 16:32:13 +0800
Subject: [PATCH 54/61] mtk: mac80211: send broadcast/multicast mgmt. via all
links.
This patch makes broadcast/multicast mgmt. be sent via all links.
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Change-id: Id1bd06694a73cc29b3f571a57c4c864ee3742441
---
net/mac80211/offchannel.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 3ed5fc5..ec1d7a1 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -976,7 +976,25 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
}
if (!need_offchan) {
- ieee80211_tx_skb_tid(sdata, skb, 7, link_id);
+ unsigned long links = sdata->vif.active_links;
+ if (is_multicast_ether_addr(mgmt->da) && hweight16(links) > 1) {
+ unsigned int link;
+ struct sk_buff *dskb;
+
+ for_each_set_bit(link, &links, IEEE80211_MLD_MAX_NUM_LINKS) {
+ dskb = skb_clone(skb, GFP_ATOMIC);
+ if (dskb) {
+ ieee80211_tx_skb_tid(sdata, dskb, 7, link);
+ } else {
+ ret = -ENOMEM;
+ kfree_skb(skb);
+ goto out_unlock;
+ }
+ }
+ kfree_skb(skb);
+ } else {
+ ieee80211_tx_skb_tid(sdata, skb, 7, link_id);
+ }
ret = 0;
goto out_unlock;
}
--
2.18.0