netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bridge: use promisc arg instead of skb flags
@ 2024-10-05  1:44 Amedeo Baragiola
  2024-10-05 14:06 ` Nikolay Aleksandrov
  0 siblings, 1 reply; 8+ messages in thread
From: Amedeo Baragiola @ 2024-10-05  1:44 UTC (permalink / raw)
  Cc: Amedeo Baragiola, Roopa Prabhu, Nikolay Aleksandrov,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	bridge, netdev, linux-kernel

Since commit 751de2012eaf ("netfilter: br_netfilter: skip conntrack input hook for promisc packets")
a second argument (promisc) has been added to br_pass_frame_up which
represents whether the interface is in promiscuous mode. However,
internally - in one remaining case - br_pass_frame_up checks the device
flags derived from skb instead of the argument being passed in.
This one-line changes addresses this inconsistency.

Signed-off-by: Amedeo Baragiola <ingamedeo@gmail.com>
---
 net/bridge/br_input.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index ceaa5a89b947..156c18f42fa3 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -50,8 +50,7 @@ static int br_pass_frame_up(struct sk_buff *skb, bool promisc)
 	 * packet is allowed except in promisc mode when someone
 	 * may be running packet capture.
 	 */
-	if (!(brdev->flags & IFF_PROMISC) &&
-	    !br_allowed_egress(vg, skb)) {
+	if (!promisc && !br_allowed_egress(vg, skb)) {
 		kfree_skb(skb);
 		return NET_RX_DROP;
 	}
-- 
2.46.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-10-11  6:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-05  1:44 [PATCH] bridge: use promisc arg instead of skb flags Amedeo Baragiola
2024-10-05 14:06 ` Nikolay Aleksandrov
2024-10-06 17:24   ` Amedeo Baragiola
2024-10-06 17:42     ` Nikolay Aleksandrov
2024-10-08 14:30   ` Pablo Neira Ayuso
2024-10-08 14:45     ` Nikolay Aleksandrov
2024-10-08 15:44       ` Pablo Neira Ayuso
2024-10-11  6:46         ` Nikolay Aleksandrov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).