336-mac80211-do-not-drop-tx-nulldata-packets-on-encrypte.patch 1020 B

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