Skip to content

Commit 59b55d0

Browse files
committed
mt76: mt76x02: only override control->sta on sw-encrypted tx
control->sta is set to NULL early when encryption is turned on for the station and info->control.hw_key is not set. This code is missing a check for the 802.11 header protected flag, otherwise it resets the station for other frames, e.g. client probing frames. Signed-off-by: Felix Fietkau <[email protected]>
1 parent 65b526a commit 59b55d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
void mt76x02_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
2323
struct sk_buff *skb)
2424
{
25+
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
2526
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
2627
struct mt76x02_dev *dev = hw->priv;
2728
struct ieee80211_vif *vif = info->control.vif;
@@ -33,7 +34,8 @@ void mt76x02_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
3334
msta = (struct mt76x02_sta *)control->sta->drv_priv;
3435
wcid = &msta->wcid;
3536
/* sw encrypted frames */
36-
if (!info->control.hw_key && wcid->hw_key_idx != 0xff)
37+
if (!info->control.hw_key && wcid->hw_key_idx != 0xff &&
38+
ieee80211_has_protected(hdr->frame_control))
3739
control->sta = NULL;
3840
}
3941

0 commit comments

Comments
 (0)