imagebuilder: export SOURCE_DATE_EPOCH to environment
[openwrt/staging/ansuel.git] / package / kernel / mac80211 / patches / subsys / 300-mac80211-fix-rate-control-for-retransmitted-frames.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Mon, 22 Nov 2021 21:39:38 +0100
3 Subject: [PATCH] mac80211: fix rate control for retransmitted frames
4
5 Since retransmission clears info->control, rate control needs to be called
6 again, otherwise the driver might crash due to invalid rates.
7
8 Cc: stable@vger.kernel.org # 5.14+
9 Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
10 Reported-by: Robert W <rwbugreport@lost-in-the-void.net>
11 Fixes: 03c3911d2d67 ("mac80211: call ieee80211_tx_h_rate_ctrl() when dequeue")
12 Signed-off-by: Felix Fietkau <nbd@nbd.name>
13 ---
14
15 --- a/net/mac80211/tx.c
16 +++ b/net/mac80211/tx.c
17 @@ -1821,15 +1821,15 @@ static int invoke_tx_handlers_late(struc
18 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
19 ieee80211_tx_result res = TX_CONTINUE;
20
21 + if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
22 + CALL_TXH(ieee80211_tx_h_rate_ctrl);
23 +
24 if (unlikely(info->flags & IEEE80211_TX_INTFL_RETRANSMISSION)) {
25 __skb_queue_tail(&tx->skbs, tx->skb);
26 tx->skb = NULL;
27 goto txh_done;
28 }
29
30 - if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
31 - CALL_TXH(ieee80211_tx_h_rate_ctrl);
32 -
33 CALL_TXH(ieee80211_tx_h_michael_mic_add);
34 CALL_TXH(ieee80211_tx_h_sequence);
35 CALL_TXH(ieee80211_tx_h_fragment);