]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: Really fix vti6 with oif in dst lookups
authorDavid Ahern <dsa@cumulusnetworks.com>
Mon, 19 Oct 2015 15:26:05 +0000 (08:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Oct 2015 02:04:54 +0000 (19:04 -0700)
9c0a132059f9 ("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: 4fb8ab9aa1a2 ("xfrm: Add oif to dst lookups")
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c
net/ipv6/route.c

index 61d403ee1031caa5536d9298abd4604606dff6f5..d03d6da772f3bc394aaee0aa7e6694bed6cf56ac 100644 (file)
@@ -877,7 +877,8 @@ static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
 #ifdef CONFIG_IPV6_SUBTREES
            ip6_rt_check(&rt->rt6i_src, &fl6->saddr, np->saddr_cache) ||
 #endif
-           (fl6->flowi6_oif && fl6->flowi6_oif != dst->dev->ifindex)) {
+          (!(fl6->flowi6_flags & FLOWI_FLAG_SKIP_NH_OIF) &&
+             (fl6->flowi6_oif && fl6->flowi6_oif != dst->dev->ifindex))) {
                dst_release(dst);
                dst = NULL;
        }
index 968f31c01f89e8ccc6a4a13c056f8be3dcc0b7c6..be5d2879b5d81035b177d34a63fe472811959476 100644 (file)
@@ -1068,6 +1068,9 @@ static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
        fn = fib6_lookup(&table->tb6_root, &fl6->daddr, &fl6->saddr);
        saved_fn = fn;
 
+       if (fl6->flowi6_flags & FLOWI_FLAG_SKIP_NH_OIF)
+               oif = 0;
+
 redo_rt6_select:
        rt = rt6_select(fn, oif, strict);
        if (rt->rt6i_nsiblings)