mt76: do not store aggregation sequence number for null-data frames
authorFelix Fietkau <nbd@nbd.name>
Mon, 8 Oct 2018 08:39:24 +0000 (10:39 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sat, 13 Oct 2018 15:39:34 +0000 (17:39 +0200)
Fixes a rare corner case where a BlockAckReq might get the wrong
sequence number.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/tx.c

index bf0e9e666bc4979efc4ccefebd257f0fd4f7a807..7cbce03aa65b96c3eee1cfbf75a92879005dcb64 100644 (file)
@@ -96,7 +96,8 @@ mt76_check_agg_ssn(struct mt76_txq *mtxq, struct sk_buff *skb)
 {
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
 
-       if (!ieee80211_is_data_qos(hdr->frame_control))
+       if (!ieee80211_is_data_qos(hdr->frame_control) ||
+           !ieee80211_is_data_present(hdr->frame_control))
                return;
 
        mtxq->agg_ssn = le16_to_cpu(hdr->seq_ctrl) + 0x10;