From: Andrei Otcheretianski Date: Mon, 14 Oct 2013 08:46:55 +0000 (+0200) Subject: mac80211: fix honouring rate flags in low-rate transmit X-Git-Tag: next-20131021~116^2~5^2~2 X-Git-Url: https://git.kernelconcepts.de/?a=commitdiff_plain;h=1431fcb74eb5c67d3c38db5e5fe60b726c204273;p=karo-tx-linux.git mac80211: fix honouring rate flags in low-rate transmit Transmissions with the IEEE80211_TX_CTL_NO_CCK_RATE flag set (which can come from userspace) were no longer guaranteed to be transmitted with allowed rates since commit 2103dec14792b ("mac80211: select and adjust bitrates according to channel mode") due to a missing rate_flags check in that commit. The commit also introduced the need to check the 5/10 MHz flags but accidentally didn't. Fix it by adding the missing check. Signed-off-by: Andrei Otcheretianski Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index e126605cec66..7f7ce1173bf6 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -247,6 +247,9 @@ static void __rate_control_send_low(struct ieee80211_hw *hw, info->control.rates[0].idx = 0; for (i = 0; i < sband->n_bitrates; i++) { + if ((rate_flags & sband->bitrates[i].flags) != rate_flags) + continue; + if (!rate_supported(sta, sband->band, i)) continue;