]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: cfg80211: add monitor SKIP_TX flag
authorFelix Fietkau <nbd@nbd.name>
Wed, 9 Oct 2024 08:25:49 +0000 (10:25 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Oct 2024 14:46:06 +0000 (16:46 +0200)
This can be used to indicate that the user is not interested in receiving
locally sent packets on the monitor interface.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/f0c20f832eadd36c71fba9a2a16ba57d78389b6c.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
include/uapi/linux/nl80211.h
net/wireless/nl80211.c

index 5feb93ba04009335a5b160823a2d274af0c5101e..8f9853b1a5d144670c02632850aa096dbaab24ed 100644 (file)
@@ -2267,6 +2267,7 @@ static inline int cfg80211_get_station(struct net_device *dev,
  * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering
  * @MONITOR_FLAG_COOK_FRAMES: report frames after processing
  * @MONITOR_FLAG_ACTIVE: active monitor, ACKs frames on its MAC address
+ * @MONITOR_FLAG_SKIP_TX: do not pass locally transmitted frames
  */
 enum monitor_flags {
        MONITOR_FLAG_CHANGED            = BIT(__NL80211_MNTR_FLAG_INVALID),
@@ -2276,6 +2277,7 @@ enum monitor_flags {
        MONITOR_FLAG_OTHER_BSS          = BIT(NL80211_MNTR_FLAG_OTHER_BSS),
        MONITOR_FLAG_COOK_FRAMES        = BIT(NL80211_MNTR_FLAG_COOK_FRAMES),
        MONITOR_FLAG_ACTIVE             = BIT(NL80211_MNTR_FLAG_ACTIVE),
+       MONITOR_FLAG_SKIP_TX            = BIT(NL80211_MNTR_FLAG_SKIP_TX),
 };
 
 /**
index 1b8827f920ff70563f627e27af2ac62b73f5786e..6d11437596b9109f9dc320cf7fa8978233cb24f2 100644 (file)
@@ -4703,6 +4703,7 @@ enum nl80211_survey_info {
  *     overrides all other flags.
  * @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address
  *     and ACK incoming unicast packets.
+ * @NL80211_MNTR_FLAG_SKIP_TX: do not pass local tx packets
  *
  * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
  * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
@@ -4715,6 +4716,7 @@ enum nl80211_mntr_flags {
        NL80211_MNTR_FLAG_OTHER_BSS,
        NL80211_MNTR_FLAG_COOK_FRAMES,
        NL80211_MNTR_FLAG_ACTIVE,
+       NL80211_MNTR_FLAG_SKIP_TX,
 
        /* keep last */
        __NL80211_MNTR_FLAG_AFTER_LAST,
index 84015f56e93a04336bbc4b0c2ad12339ead5201a..4a8c3b6d49d1ee97031c0058449a80fe57617072 100644 (file)
@@ -4206,6 +4206,7 @@ static const struct nla_policy mntr_flags_policy[NL80211_MNTR_FLAG_MAX + 1] = {
        [NL80211_MNTR_FLAG_OTHER_BSS] = { .type = NLA_FLAG },
        [NL80211_MNTR_FLAG_COOK_FRAMES] = { .type = NLA_FLAG },
        [NL80211_MNTR_FLAG_ACTIVE] = { .type = NLA_FLAG },
+       [NL80211_MNTR_FLAG_SKIP_TX] = { .type = NLA_FLAG },
 };
 
 static int parse_monitor_flags(struct nlattr *nla, u32 *mntrflags)