summaryrefslogtreecommitdiff
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2022-07-18 16:58:18 +0200
committerJohannes Berg <johannes.berg@intel.com>2022-07-22 14:27:58 +0200
commit0f13f3c3222a0463013f73b9d4b31ac4ebdc884a (patch)
tree539de7dae265819ad129805ff1bd189283ba1606 /net/mac80211/tx.c
parente4c9050a0dee71fc24e5d93a1003f18a3c6f6f88 (diff)
wifi: mac80211: fast-xmit: handle non-MLO clients
If there's a non-MLO client, the A2 must be set to the BSSID of the link since no translation will happen in lower layers and it's needed that way for encryption. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index cded1b207b73..f246b3d264ee 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3045,7 +3045,21 @@ void ieee80211_check_fast_xmit(struct sta_info *sta)
fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS);
/* DA BSSID SA */
build.da_offs = offsetof(struct ieee80211_hdr, addr1);
- memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN);
+ if (sta->sta.mlo || !sdata->vif.valid_links) {
+ memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN);
+ } else {
+ unsigned int link_id = sta->deflink.link_id;
+ struct ieee80211_link_data *link;
+
+ rcu_read_lock();
+ link = rcu_dereference(sdata->link[link_id]);
+ if (WARN_ON(!link)) {
+ rcu_read_unlock();
+ goto out;
+ }
+ memcpy(hdr->addr2, link->conf->addr, ETH_ALEN);
+ rcu_read_unlock();
+ }
build.sa_offs = offsetof(struct ieee80211_hdr, addr3);
build.hdr_len = 24;
break;