Skip to content

Commit f1900fb

Browse files
David Aherndavem330
authored andcommitted
net: Really fix vti6 with oif in dst lookups
6e28b00 ("net: Fix vti use case with oif in dst lookups for IPv6") is missing the checks on FLOWI_FLAG_SKIP_NH_OIF. Add them. Fixes: 42a7b32 ("xfrm: Add oif to dst lookups") Cc: Steffen Klassert <[email protected]> Signed-off-by: David Ahern <[email protected]> Acked-by: Steffen Klassert <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 53387c4 commit f1900fb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

net/ipv6/ip6_output.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,8 @@ static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
877877
#ifdef CONFIG_IPV6_SUBTREES
878878
ip6_rt_check(&rt->rt6i_src, &fl6->saddr, np->saddr_cache) ||
879879
#endif
880-
(fl6->flowi6_oif && fl6->flowi6_oif != dst->dev->ifindex)) {
880+
(!(fl6->flowi6_flags & FLOWI_FLAG_SKIP_NH_OIF) &&
881+
(fl6->flowi6_oif && fl6->flowi6_oif != dst->dev->ifindex))) {
881882
dst_release(dst);
882883
dst = NULL;
883884
}

net/ipv6/route.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,9 @@ static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
10681068
fn = fib6_lookup(&table->tb6_root, &fl6->daddr, &fl6->saddr);
10691069
saved_fn = fn;
10701070

1071+
if (fl6->flowi6_flags & FLOWI_FLAG_SKIP_NH_OIF)
1072+
oif = 0;
1073+
10711074
redo_rt6_select:
10721075
rt = rt6_select(fn, oif, strict);
10731076
if (rt->rt6i_nsiblings)

0 commit comments

Comments
 (0)