1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 18 Dec 2020 20:08:06 +0100
3 Subject: [PATCH] mac80211: do not drop tx nulldata packets on encrypted links
5 ieee80211_tx_h_select_key drops any non-mgmt packets without a key when
6 encryption is used. This is wrong for nulldata packets that can't be
7 encrypted and are sent out for probing clients and indicating 4-address
10 Reported-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
11 Fixes: a0761a301746 ("mac80211: drop data frames without key on encrypted links")
12 Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 --- a/net/mac80211/tx.c
16 +++ b/net/mac80211/tx.c
17 @@ -658,7 +658,7 @@ ieee80211_tx_h_select_key(struct ieee802
18 if (!skip_hw && tx->key &&
19 tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
20 info->control.hw_key = &tx->key->conf;
21 - } else if (!ieee80211_is_mgmt(hdr->frame_control) && tx->sta &&
22 + } else if (ieee80211_is_data_present(hdr->frame_control) && tx->sta &&
23 test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) {