Thread (36 messages) 36 messages, 5 authors, 2025-06-12

Re: [PATCH net-next 07/14] net: ipv6: ip6mr: Fix in/out netdev to pass to the FORWARD chain

From: Nikolay Aleksandrov <razor@blackwall.org>
Date: 2025-06-12 10:31:02

On 6/9/25 23:50, Petr Machata wrote:
The netfilter hook is invoked with skb->dev for input netdevice, and
vif_dev for output netdevice. However at the point of invocation, skb->dev
is already set to vif_dev, and MR-forwarded packets are reported with
in=out:

  # ip6tables -A FORWARD -j LOG --log-prefix '[forw]'
  # cd tools/testing/selftests/net/forwarding
  # ./router_multicast.sh
  # dmesg | fgrep '[forw]'
  [ 1670.248245] [forw]IN=v5 OUT=v5 [...]

For reference, IPv4 MR code shows in and out as appropriate.
Fix by caching skb->dev and using the updated value for output netdev.

Fixes: 7bc570c8b4f7 ("[IPV6] MROUTE: Support multicast forwarding.")
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---

Notes:
     This never worked correctly, hence going through net-next.
---
CC: YOSHIFUJI Hideaki <redacted>

  net/ipv6/ip6mr.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help