]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: filter on monitor interfaces based on configured channel
authorFelix Fietkau <nbd@nbd.name>
Wed, 9 Oct 2024 08:25:52 +0000 (10:25 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Oct 2024 14:46:34 +0000 (16:46 +0200)
When a monitor interface has an assigned channel (only happens with the
NO_VIRTUAL_MONITOR feature), only pass packets received on that channel.
This is useful for monitoring on multiple channels at the same time using
multiple monitor interfaces.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/1bbe55107ba0f2e62ea90f305faeb7ba9247ef29.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rx.c

index 4849af232ee6fb8923dc200fa2ebfedf649639b1..2bec18fc1b035b0796dd3270e32044e387754eb4 100644 (file)
@@ -837,6 +837,13 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
        ieee80211_handle_mu_mimo_mon(monitor_sdata, origskb, rtap_space);
 
        list_for_each_entry_rcu(sdata, &local->mon_list, u.mntr.list) {
+               struct cfg80211_chan_def *chandef;
+
+               chandef = &sdata->vif.bss_conf.chanreq.oper;
+               if (chandef->chan &&
+                   chandef->chan->center_freq != status->freq)
+                       continue;
+
                if (!prev_sdata) {
                        prev_sdata = sdata;
                        continue;