All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathy Vanhoef <Mathy.Vanhoef@kuleuven.be>
To: johannes@sipsolutions.net, linux-wireless@vger.kernel.org
Cc: Mathy Vanhoef <Mathy.Vanhoef@kuleuven.be>
Subject: [PATCH 2/6] mac80211: add radiotap flag to prevent sequence number overwrite
Date: Thu, 23 Jul 2020 14:01:49 +0400	[thread overview]
Message-ID: <20200723100153.31631-2-Mathy.Vanhoef@kuleuven.be> (raw)
In-Reply-To: <20200723100153.31631-1-Mathy.Vanhoef@kuleuven.be>

The radiotap specification contains a flag to indicate that the sequence
number of an injected frame should not be overwritten. Parse this flag
and define and set a corresponding Tx control flag.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@kuleuven.be>
---
 include/net/ieee80211_radiotap.h | 1 +
 include/net/mac80211.h           | 3 +++
 net/mac80211/tx.c                | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index 459d355f6..19c00d100 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -117,6 +117,7 @@ enum ieee80211_radiotap_tx_flags {
 	IEEE80211_RADIOTAP_F_TX_CTS = 0x0002,
 	IEEE80211_RADIOTAP_F_TX_RTS = 0x0004,
 	IEEE80211_RADIOTAP_F_TX_NOACK = 0x0008,
+	IEEE80211_RADIOTAP_F_TX_NOSEQNO = 0x0010,
 };
 
 /* for IEEE80211_RADIOTAP_MCS "have" flags */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 11d5610d2..6615fe450 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -825,6 +825,8 @@ enum mac80211_tx_info_flags {
  * @IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP: This frame skips mesh path lookup
  * @IEEE80211_TX_CTRL_HW_80211_ENCAP: This frame uses hardware encapsulation
  *	(header conversion)
+ * @IEEE80211_TX_CTRL_NO_SEQNO: Do not overwrite the sequence number that
+ *	has already been assigned to this frame.
  *
  * These flags are used in tx_info->control.flags.
  */
@@ -836,6 +838,7 @@ enum mac80211_tx_control_flags {
 	IEEE80211_TX_CTRL_FAST_XMIT		= BIT(4),
 	IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP	= BIT(5),
 	IEEE80211_TX_CTRL_HW_80211_ENCAP	= BIT(6),
+	IEEE80211_TX_CTRL_NO_SEQNO		= BIT(7),
 };
 
 /*
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 62d01ab26..040b0ef18 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2084,6 +2084,8 @@ static bool ieee80211_parse_tx_radiotap(struct ieee80211_local *local,
 			txflags = get_unaligned_le16(iterator.this_arg);
 			if (txflags & IEEE80211_RADIOTAP_F_TX_NOACK)
 				info->flags |= IEEE80211_TX_CTL_NO_ACK;
+			if (txflags & IEEE80211_RADIOTAP_F_TX_NOSEQNO)
+				info->control.flags |= IEEE80211_TX_CTRL_NO_SEQNO;
 			break;
 
 		case IEEE80211_RADIOTAP_RATE:
-- 
2.27.0


  reply	other threads:[~2020-07-23 10:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23  8:51 [PATCH 0/6] mac80211: monitor mode injection fixes Mathy Vanhoef
2020-07-23 10:01 ` [PATCH 1/6] mac80211: never drop injected frames even if normally not allowed Mathy Vanhoef
2020-07-23 10:01   ` Mathy Vanhoef [this message]
2020-07-23 10:01   ` [PATCH 3/6] mac80211: do not overwrite the sequence number if requested Mathy Vanhoef
2020-07-23 10:01   ` [PATCH 4/6] mac80211: use same flag everywhere to avoid sequence number overwrite Mathy Vanhoef
2020-07-23 10:01   ` [PATCH 5/6] mac80211: remove unused flags argument in transmit functions Mathy Vanhoef
2020-07-23 10:01   ` [PATCH 6/6] mac80211: parse radiotap header when selecting Tx queue Mathy Vanhoef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200723100153.31631-2-Mathy.Vanhoef@kuleuven.be \
    --to=mathy.vanhoef@kuleuven.be \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.