From 9955151df7c6452cae2ed9649f53d265c91cf155 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=A1bor=20Stefanik?= Date: Thu, 23 Apr 2009 19:36:14 +0200 Subject: [PATCH] mac80211: Warn if the rate controller requests retries for a NO_ACK frame MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To deter future rate scaling algorithm writers from requesting NO_ACK packets to be retried, throw a WARN_ON_ONCE if the algorithm hands us a try count over 1 for NO_ACK packet. Signed-off-by: Gábor Stefanik Signed-off-by: John W. Linville --- net/mac80211/tx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 1564a3018cf..36e8e2de980 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -558,6 +558,10 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx) if (unlikely(!info->control.rates[0].count)) info->control.rates[0].count = 1; + if (WARN_ON_ONCE((info->control.rates[0].count > 1) && + (info->flags & IEEE80211_TX_CTL_NO_ACK))) + info->control.rates[0].count = 1; + if (is_multicast_ether_addr(hdr->addr1)) { /* * XXX: verify the rate is in the basic rateset -- 2.11.4.GIT