blob: 25fbe6c427ce9cd2a211bde60146cd84c59d5fb9 [file] [log] [blame]
developer617abbd2024-04-23 14:50:01 +08001From de8d3f6fa5fdebd105e1c7e99f635c94e7f37344 Mon Sep 17 00:00:00 2001
2From: 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
12Change-Id: Ie94fbb22ca2cf7a96d94897e74314b5c61153380
13CR-Id: WCNCR00289305
14Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
15---
16 net/mac80211/tx.c | 7 +++++++
17 1 file changed, 7 insertions(+)
18
19diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
20index e72bb7e..2808bc2 100644
21--- a/net/mac80211/tx.c
22+++ b/net/mac80211/tx.c
23@@ -1234,6 +1234,13 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
24 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) {
25 tx->sta = sta_info_get(sdata, hdr->addr1);
26 aggr_check = true;
27+
28+ if (!tx->sta) {
29+ tx->sta = sta_info_get_bss(sdata, hdr->addr1);
30+ if (!tx->sta || !tx->sta->sdata->wdev.use_4addr ||
31+ tx->sta->sdata->vif.type != NL80211_IFTYPE_AP_VLAN)
32+ tx->sta = NULL;
33+ }
34 }
35 }
36
37--
382.39.2
39