diff mbox series

[wpan/next,v3,4/9] net: mac802154: Don't limit the FILTER_NONE level to monitors

Message ID 20220905203412.1322947-5-miquel.raynal@bootlin.com (mailing list archive)
State Superseded
Headers show
Series net: ieee802154: Support scanning/beaconing | expand

Commit Message

Miquel Raynal Sept. 5, 2022, 8:34 p.m. UTC
Historically, only monitors were using promiscuous mode and this
promiscuous mode was not the one from the spec but actually implied no
filtering at all (sniffers). Now that we have a more fine grained
approach, we can ensure all interfaces which would be expecting no
filter at all could get it without being a monitor interface.

Having this in place will allow us to clarify the additional software
checks compared to the hardware capabilities.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 net/mac802154/rx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c
index 369ffd800abf..26df79911f3e 100644
--- a/net/mac802154/rx.c
+++ b/net/mac802154/rx.c
@@ -205,10 +205,10 @@  __ieee802154_rx_handle_packet(struct ieee802154_local *local,
 	}
 
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-		if (sdata->wpan_dev.iftype != NL802154_IFTYPE_NODE)
+		if (!ieee802154_sdata_running(sdata))
 			continue;
 
-		if (!ieee802154_sdata_running(sdata))
+		if (sdata->required_filtering == IEEE802154_FILTERING_NONE)
 			continue;
 
 		ieee802154_subif_frame(sdata, skb, &hdr);
@@ -231,10 +231,10 @@  ieee802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb)
 	skb->protocol = htons(ETH_P_IEEE802154);
 
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-		if (sdata->wpan_dev.iftype != NL802154_IFTYPE_MONITOR)
+		if (!ieee802154_sdata_running(sdata))
 			continue;
 
-		if (!ieee802154_sdata_running(sdata))
+		if (sdata->required_filtering > IEEE802154_FILTERING_NONE)
 			continue;
 
 		skb2 = skb_clone(skb, GFP_ATOMIC);