blob: 41f46d66eedec2dbb158260ec8f03f00edaf9349 [file] [log] [blame]
developerdad89a32024-04-29 14:17:17 +08001From d90c8383297753b4d89012b6b5e5760e919b6503 Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: Michael-CY Lee <michael-cy.lee@mediatek.com>
3Date: Thu, 25 Jan 2024 14:07:23 +0800
4Subject: [PATCH 50/61] mtk: mac80211: fix AP mgmt not encrypted in WDS mode
5 with PMF on
6
7In ieee80211_tx_prepare(), if tx->sta is still NULL after calling
8sta_info_get(), the skb might be mgmt for WDS peer, so sta_info_get_bss()
9if called to find sta from AP_VLAN, and then interface type & 4-addr
10using is checked.
11
developer66e89bc2024-04-23 14:50:01 +080012Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
13---
14 net/mac80211/tx.c | 7 +++++++
15 1 file changed, 7 insertions(+)
16
17diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
18index e72bb7e..2808bc2 100644
19--- a/net/mac80211/tx.c
20+++ b/net/mac80211/tx.c
21@@ -1234,6 +1234,13 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
22 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) {
23 tx->sta = sta_info_get(sdata, hdr->addr1);
24 aggr_check = true;
25+
26+ if (!tx->sta) {
27+ tx->sta = sta_info_get_bss(sdata, hdr->addr1);
28+ if (!tx->sta || !tx->sta->sdata->wdev.use_4addr ||
29+ tx->sta->sdata->vif.type != NL80211_IFTYPE_AP_VLAN)
30+ tx->sta = NULL;
31+ }
32 }
33 }
34
35--
developerdad89a32024-04-29 14:17:17 +0800362.18.0
developer66e89bc2024-04-23 14:50:01 +080037