| From 918df54f28978540816e00860677b87a36922c6a Mon Sep 17 00:00:00 2001 |
| From: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| Date: Thu, 25 Jan 2024 14:07:23 +0800 |
| Subject: [PATCH 56/89] mtk: mac80211: fix AP mgmt not encrypted in WDS mode |
| with PMF on |
| |
| In ieee80211_tx_prepare(), if tx->sta is still NULL after calling |
| sta_info_get(), the skb might be mgmt for WDS peer, so sta_info_get_bss() |
| if called to find sta from AP_VLAN, and then interface type & 4-addr |
| using is checked. |
| |
| Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| --- |
| net/mac80211/tx.c | 7 +++++++ |
| 1 file changed, 7 insertions(+) |
| |
| diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c |
| index 9e95dbd..00294cc 100644 |
| --- a/net/mac80211/tx.c |
| +++ b/net/mac80211/tx.c |
| @@ -1239,6 +1239,13 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, |
| if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) { |
| tx->sta = sta_info_get(sdata, hdr->addr1); |
| aggr_check = true; |
| + |
| + if (!tx->sta) { |
| + tx->sta = sta_info_get_bss(sdata, hdr->addr1); |
| + if (!tx->sta || !tx->sta->sdata->wdev.use_4addr || |
| + tx->sta->sdata->vif.type != NL80211_IFTYPE_AP_VLAN) |
| + tx->sta = NULL; |
| + } |
| } |
| } |
| |
| -- |
| 2.18.0 |
| |