Skip to content

Commit 34ec792

Browse files
atenartmehmetb0
authored andcommitted
net: vrf: determine the dst using the original ifindex for multicast
BugLink: https://bugs.launchpad.net/bugs/2086242 commit f2575c8 upstream. Multicast packets received on an interface bound to a VRF are marked as belonging to the VRF and the skb device is updated to point to the VRF device itself. This was fine even when a route was associated to a device as when performing a fib table lookup 'oif' in fib6_table_lookup (coming from 'skb->dev->ifindex' in ip6_route_input) was set to 0 when FLOWI_FLAG_SKIP_NH_OIF was set. With commit 40867d7 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices") this is not longer true and multicast traffic is not received on the original interface. Instead of adding back a similar check in fib6_table_lookup determine the dst using the original ifindex for multicast VRF traffic. To make things consistent across the function do the above for all strict packets, which was the logic before commit 6f12fa7 ("vrf: mark skb for multicast or link-local as enslaved to VRF"). Note that reverting to this behavior should be fine as the change was about marking packets belonging to the VRF, not about their dst. Fixes: 40867d7 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices") Reported-by: Jianlin Shi <[email protected]> Signed-off-by: Antoine Tenart <[email protected]> Reviewed-by: David Ahern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Koichiro Den <[email protected]> Signed-off-by: Roxana Nicolescu <[email protected]>
1 parent 222b4bf commit 34ec792

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/vrf.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1384,8 +1384,8 @@ static struct sk_buff *vrf_ip6_rcv(struct net_device *vrf_dev,
13841384

13851385
/* loopback, multicast & non-ND link-local traffic; do not push through
13861386
* packet taps again. Reset pkt_type for upper layers to process skb.
1387-
* For strict packets with a source LLA, determine the dst using the
1388-
* original ifindex.
1387+
* For non-loopback strict packets, determine the dst using the original
1388+
* ifindex.
13891389
*/
13901390
if (skb->pkt_type == PACKET_LOOPBACK || (need_strict && !is_ndisc)) {
13911391
skb->dev = vrf_dev;
@@ -1394,7 +1394,7 @@ static struct sk_buff *vrf_ip6_rcv(struct net_device *vrf_dev,
13941394

13951395
if (skb->pkt_type == PACKET_LOOPBACK)
13961396
skb->pkt_type = PACKET_HOST;
1397-
else if (ipv6_addr_type(&ipv6_hdr(skb)->saddr) & IPV6_ADDR_LINKLOCAL)
1397+
else
13981398
vrf_ip6_input_dst(skb, vrf_dev, orig_iif);
13991399

14001400
goto out;

0 commit comments

Comments
 (0)