mac80211: add radiotap flag to prevent sequence number overwrite
authorMathy Vanhoef <Mathy.Vanhoef@kuleuven.be>
Thu, 23 Jul 2020 10:01:49 +0000 (14:01 +0400)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 31 Jul 2020 07:27:00 +0000 (09:27 +0200)
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>
Link: https://lore.kernel.org/r/20200723100153.31631-2-Mathy.Vanhoef@kuleuven.be
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/ieee80211_radiotap.h
include/net/mac80211.h
net/mac80211/tx.c

index 459d355f6506b3a8c46ed35ae807c018a415492b..19c00d10009677bac7cff568fff7a417ee5cefa5 100644 (file)
@@ -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 */
index c0a597167f14d5a64d7b54b2d0763d2c2ea4b568..21ce821a25e78c049a23d32bfc2db895a7cf3786 100644 (file)
@@ -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),
 };
 
 /*
index 007e070227fd0604cee6f08143338528937e0309..413345056445c3b5161256ed85ba4a2d60d1310a 100644 (file)
@@ -2085,6 +2085,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: