ath9k: discard undersized packets
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 322-ath9k-discard-undersized-packets.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 17 Jan 2018 11:11:17 +0100
3 Subject: [PATCH] ath9k: discard undersized packets
4
5 Sometimes the hardware will push small packets that trigger a WARN_ON
6 in mac80211. Discard them early to avoid this issue.
7
8 Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
10 ---
11
12 --- a/drivers/net/wireless/ath/ath9k/recv.c
13 +++ b/drivers/net/wireless/ath/ath9k/recv.c
14 @@ -826,9 +826,9 @@ static int ath9k_rx_skb_preprocess(struc
15 sc->rx.discard_next = false;
16
17 /*
18 - * Discard zero-length packets.
19 + * Discard zero-length packets and packets smaller than an ACK
20 */
21 - if (!rx_stats->rs_datalen) {
22 + if (rx_stats->rs_datalen < 10) {
23 RX_STAT_INC(rx_len_err);
24 goto corrupt;
25 }