Skip to content

Commit 409c280

Browse files
Phil Suttermehmetb0
Phil Sutter
authored andcommitted
netfilter: ip6t_rpfilter: Fix regression with VRF interfaces
BugLink: https://bugs.launchpad.net/bugs/2086242 commit efb056e upstream. When calling ip6_route_lookup() for the packet arriving on the VRF interface, the result is always the real (slave) interface. Expect this when validating the result. Fixes: acc641a ("netfilter: rpfilter/fib: Populate flowic_l3mdev field") Signed-off-by: Phil Sutter <[email protected]> Signed-off-by: Pablo Neira Ayuso <[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 34ec792 commit 409c280

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/ipv6/netfilter/ip6t_rpfilter.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ static bool rpfilter_lookup_reverse6(struct net *net, const struct sk_buff *skb,
7272
goto out;
7373
}
7474

75-
if (rt->rt6i_idev->dev == dev || (flags & XT_RPFILTER_LOOSE))
75+
if (rt->rt6i_idev->dev == dev ||
76+
l3mdev_master_ifindex_rcu(rt->rt6i_idev->dev) == dev->ifindex ||
77+
(flags & XT_RPFILTER_LOOSE))
7678
ret = true;
7779
out:
7880
ip6_rt_put(rt);

0 commit comments

Comments
 (0)