aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2022-08-24 12:30:16 +0200
committerJohannes Berg <johannes.berg@intel.com>2022-08-25 10:41:31 +0200
commita6ba64d0b187109dc252969c1fc9e2525868bd49 (patch)
tree65589d4c2c39b4f88526f28e6cad906c680661fb
parentwifi: mac80211: set link ID in TX info for beacons (diff)
downloadlinux-dev-a6ba64d0b187109dc252969c1fc9e2525868bd49.tar.xz
linux-dev-a6ba64d0b187109dc252969c1fc9e2525868bd49.zip
wifi: mac80211: fix control port frame addressing
For an AP interface, when userspace specifieds the link ID to transmit the control port frame on (in particular for the initial 4-way-HS), due to the logic in ieee80211_build_hdr() for a frame transmitted from/to an MLD, we currently build a header with A1 = DA = MLD address of the peer MLD A2 = local link address (!) A3 = SA = local MLD address This clearly makes no sense, and leads to two problems: - if the frame were encrypted (not true for the initial 4-way-HS) the AAD would be calculated incorrectly - if iTXQs are used, the frame is dropped by logic in ieee80211_tx_dequeue() Fix the addressing, which fixes the first bullet, and the second bullet for peer MLDs, I'll fix the second one for non-MLD peers separately. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/tx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 9d5963a32da4..1c2658e4976f 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2676,7 +2676,8 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
goto free;
}
memcpy(hdr.addr2, link->conf->addr, ETH_ALEN);
- } else if (link_id == IEEE80211_LINK_UNSPECIFIED) {
+ } else if (link_id == IEEE80211_LINK_UNSPECIFIED ||
+ (sta && sta->sta.mlo)) {
memcpy(hdr.addr2, sdata->vif.addr, ETH_ALEN);
} else {
struct ieee80211_bss_conf *conf;