diff mbox series

[2/4] mac80211: fix bad guard when reporting legacy rates

Message ID 20190807075949.32414-2-john@phrozen.org (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series [1/4] mac80211: fix TX legacy rate reporting when tx_status_ext is used | expand

Commit Message

John Crispin Aug. 7, 2019, 7:59 a.m. UTC
When reporting legacy rates inside the TX Radiotap header we need to split
the check u between "uses tx_statua_ext" and "is legacy rate". Not doing so
would make the code drop into the !tx_status_ext path.

fixes commit 3d07ffcaf320 ("mac80211: add struct ieee80211_tx_status
support to ieee80211_add_tx_radiotap_header")

Signed-off-by: John Crispin <john@phrozen.org>
---
 net/mac80211/status.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index f984943cdabd..eaea07db83e7 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -327,13 +327,14 @@  ieee80211_add_tx_radiotap_header(struct ieee80211_local *local,
 
 	/* IEEE80211_RADIOTAP_RATE */
 
-	if (status && status->rate && !(status->rate->flags &
-					(RATE_INFO_FLAGS_MCS |
-					 RATE_INFO_FLAGS_60G |
-					 RATE_INFO_FLAGS_VHT_MCS |
-					 RATE_INFO_FLAGS_HE_MCS)))
-		legacy_rate = status->rate->legacy;
-	else if (info->status.rates[0].idx >= 0 &&
+	if (status && status->rate) {
+		if (!(status->rate->flags &
+		      (RATE_INFO_FLAGS_MCS |
+		       RATE_INFO_FLAGS_60G |
+		       RATE_INFO_FLAGS_VHT_MCS |
+		       RATE_INFO_FLAGS_HE_MCS)))
+			legacy_rate = status->rate->legacy;
+	} else if (info->status.rates[0].idx >= 0 &&
 		 !(info->status.rates[0].flags & (IEEE80211_TX_RC_MCS |
 						  IEEE80211_TX_RC_VHT_MCS)))
 		legacy_rate =