diff mbox

mac80211: fixup radiotap tx flags for RTS/CTS

Message ID 1397651561-29820-1-git-send-email-me@bobcopeland.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Bob Copeland April 16, 2014, 12:32 p.m. UTC
When using RTS/CTS, the CTS-to-Self bit in radiotap TX flags is
getting set instead of the RTS bit.  Set the correct one.

Reported-by: Larry Maxwell <larrymaxwell@agilemesh.com>
Signed-off-by: Bob Copeland <bob@cozybit.com>
---
 net/mac80211/status.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Johannes Berg April 22, 2014, 3:08 p.m. UTC | #1
On Wed, 2014-04-16 at 08:32 -0400, Bob Copeland wrote:
> When using RTS/CTS, the CTS-to-Self bit in radiotap TX flags is
> getting set instead of the RTS bit.  Set the correct one.

Good catch, applied.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Berg April 22, 2014, 3:09 p.m. UTC | #2
On Wed, 2014-04-16 at 08:32 -0400, Bob Copeland wrote:
> When using RTS/CTS, the CTS-to-Self bit in radiotap TX flags is
> getting set instead of the RTS bit.  Set the correct one.

Note that the whole TX flags field hasn't been standardised in radiotap
yet - somebody should probably take that up. :)

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index e6e574a..ea432ca 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -314,10 +314,9 @@  ieee80211_add_tx_radiotap_header(struct ieee80211_local *local,
 	    !is_multicast_ether_addr(hdr->addr1))
 		txflags |= IEEE80211_RADIOTAP_F_TX_FAIL;
 
-	if ((info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) ||
-	    (info->status.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT))
+	if (info->status.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT)
 		txflags |= IEEE80211_RADIOTAP_F_TX_CTS;
-	else if (info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
+	if (info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
 		txflags |= IEEE80211_RADIOTAP_F_TX_RTS;
 
 	put_unaligned_le16(txflags, pos);