[openwrt/openwrt] kernel: fix forwarding broadcast packets between vlan-on-dsa and non-dsa netdevs
LEDE Commits
lede-commits at lists.infradead.org
Sun Oct 20 09:47:17 PDT 2024
nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2a1daeaabd144ea27bdba2203d24a316d0a4fe96
commit 2a1daeaabd144ea27bdba2203d24a316d0a4fe96
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Oct 20 18:43:17 2024 +0200
kernel: fix forwarding broadcast packets between vlan-on-dsa and non-dsa netdevs
Fix conditions for handling offloaded packets
Fixes: #13430
Signed-off-by: Leon M. Busch-George <leon at georgemail.eu>
Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
...switchdev-Don-t-drop-packets-between-port.patch | 38 ++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/target/linux/generic/pending-6.6/641-net-bridge-switchdev-Don-t-drop-packets-between-port.patch b/target/linux/generic/pending-6.6/641-net-bridge-switchdev-Don-t-drop-packets-between-port.patch
new file mode 100644
index 0000000000..1c4ec61b50
--- /dev/null
+++ b/target/linux/generic/pending-6.6/641-net-bridge-switchdev-Don-t-drop-packets-between-port.patch
@@ -0,0 +1,38 @@
+From: "Leon M. Busch-George" <leon at georgemail.eu>
+Date: Sun, 20 Oct 2024 18:20:14 +0200
+Subject: [PATCH] net: bridge: switchdev: Don't drop packets between ports with
+ no hwdom
+
+nbp_switchdev_allowed_egress uses hwdom to determine whether or not a
+packet has already been forwarded to a hardware domain. For
+net_bridge_ports that aren't set up to use forward offloading, hwdom is
+set to 0. When both ingress and egress port have no hwdom,
+'cb->src_hwdom != p->hwdom' indicates that the packet is already known in
+the target domain - which it isn't - and the packet is wrongly dropped.
+
+The error was found on a bridge containing a wifi device and a VLAN
+tagging device (e.g. eth0.12). With VLAN filtering, this shouldn't happen.
+
+This patch adds a check for p->hwdom != 0 before comparing hardware
+domains to restore forwarding between ports with hwdom = 0.
+
+fwd_hwdoms are only set for ports with offloading enabled, which also
+implies a valid hwdom, so the check '!test_bit(p->hwdom, &cb->fwd_hwdoms)'
+doesn't fail in this way (yet - fingers crossed..) and it is left in place.
+
+Co-developed-by: Felix Fietkau <nbd at nbd.name>
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+Signed-off-by: Leon M. Busch-George <leon at georgemail.eu>
+---
+
+--- a/net/bridge/br_switchdev.c
++++ b/net/bridge/br_switchdev.c
+@@ -67,7 +67,7 @@ bool nbp_switchdev_allowed_egress(const
+ struct br_input_skb_cb *cb = BR_INPUT_SKB_CB(skb);
+
+ return !test_bit(p->hwdom, &cb->fwd_hwdoms) &&
+- (!skb->offload_fwd_mark || cb->src_hwdom != p->hwdom);
++ (!skb->offload_fwd_mark || !p->hwdom || cb->src_hwdom != p->hwdom);
+ }
+
+ /* Flags that can be offloaded to hardware */
More information about the lede-commits
mailing list