developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame^] | 1 | From de8d3f6fa5fdebd105e1c7e99f635c94e7f37344 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Thu, 25 Jan 2024 14:07:23 +0800 |
| 4 | Subject: [PATCH 50/61] mtk: mac80211: fix AP mgmt not encrypted in WDS mode |
| 5 | with PMF on |
| 6 | |
| 7 | In ieee80211_tx_prepare(), if tx->sta is still NULL after calling |
| 8 | sta_info_get(), the skb might be mgmt for WDS peer, so sta_info_get_bss() |
| 9 | if called to find sta from AP_VLAN, and then interface type & 4-addr |
| 10 | using is checked. |
| 11 | |
| 12 | Change-Id: Ie94fbb22ca2cf7a96d94897e74314b5c61153380 |
| 13 | CR-Id: WCNCR00289305 |
| 14 | Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 15 | --- |
| 16 | net/mac80211/tx.c | 7 +++++++ |
| 17 | 1 file changed, 7 insertions(+) |
| 18 | |
| 19 | diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c |
| 20 | index 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 | -- |
| 38 | 2.39.2 |
| 39 | |