4b2c67aeba5a87eebed4b04dc7b57fc7510abd1f
[openwrt/staging/nbd.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 2 Oct 2024 12:35:13 +0200
3 Subject: [PATCH] wifi: mac80211: filter on monitor interfaces based on
4 configured channel
5
6 When a monitor interface has an assigned channel (only happens with the
7 NO_VIRTUAL_MONITOR feature), only pass packets received on that channel.
8 This is useful for monitoring on multiple channels at the same time using
9 multiple monitor interfaces.
10
11 Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 ---
13
14 --- a/net/mac80211/rx.c
15 +++ b/net/mac80211/rx.c
16 @@ -837,6 +837,13 @@ ieee80211_rx_monitor(struct ieee80211_lo
17 ieee80211_handle_mu_mimo_mon(monitor_sdata, origskb, rtap_space);
18
19 list_for_each_entry_rcu(sdata, &local->mon_list, u.mntr.list) {
20 + struct cfg80211_chan_def *chandef;
21 +
22 + chandef = &sdata->vif.bss_conf.chanreq.oper;
23 + if (chandef->chan &&
24 + chandef->chan->center_freq != status->freq)
25 + continue;
26 +
27 if (!prev_sdata) {
28 prev_sdata = sdata;
29 continue;