d7452c29c1fad9ee170199c33b260161b603032a
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 342-mac80211-do-not-pass-injected-frames-without-a-valid.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Wed, 2 Mar 2016 15:51:40 +0100
3 Subject: [PATCH] mac80211: do not pass injected frames without a valid rate to
4 the driver
5
6 Fall back to rate control if the requested bitrate was not found.
7
8 Fixes: dfdfc2beb0dd ("mac80211: Parse legacy and HT rate in injected frames")
9 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10 ---
11
12 --- a/net/mac80211/tx.c
13 +++ b/net/mac80211/tx.c
14 @@ -1837,6 +1837,9 @@ static bool ieee80211_parse_tx_radiotap(
15 }
16 }
17
18 + if (info->control.rates[0].idx < 0)
19 + info->control.flags &= ~IEEE80211_TX_CTRL_RATE_INJECT;
20 +
21 info->control.rates[0].flags = rate_flags;
22 info->control.rates[0].count = min_t(u8, rate_retries + 1,
23 local->hw.max_rate_tries);