aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_output.c
diff options
context:
space:
mode:
authorDavid Ahern <dsa@cumulusnetworks.com>2015-10-12 14:47:10 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-13 07:55:08 -0400
commitca254490c8dfdaddb5df8a763774db0f4c5200c3 (patch)
tree44fd3b3e5c0a37c2d5288963806b350383eb150b /net/ipv6/ip6_output.c
parent35402e31366349a32b505afdfe856aeeb8d939a0 (diff)
net: Add VRF support to IPv6 stack
As with IPv4 support for VRFs added to IPv6 stack by replacing hardcoded table ids with possibly device specific ones and manipulating the oif in the flowi6. The flow flags are used to skip oif compare in nexthop lookups if the device is enslaved to a VRF via the L3 master device. Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r--net/ipv6/ip6_output.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 32583b507c2e..23f97c4783bb 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -55,6 +55,7 @@
55#include <net/xfrm.h> 55#include <net/xfrm.h>
56#include <net/checksum.h> 56#include <net/checksum.h>
57#include <linux/mroute6.h> 57#include <linux/mroute6.h>
58#include <net/l3mdev.h>
58 59
59static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff *skb) 60static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff *skb)
60{ 61{
@@ -885,7 +886,8 @@ static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
885#ifdef CONFIG_IPV6_SUBTREES 886#ifdef CONFIG_IPV6_SUBTREES
886 ip6_rt_check(&rt->rt6i_src, &fl6->saddr, np->saddr_cache) || 887 ip6_rt_check(&rt->rt6i_src, &fl6->saddr, np->saddr_cache) ||
887#endif 888#endif
888 (fl6->flowi6_oif && fl6->flowi6_oif != dst->dev->ifindex)) { 889 (!(fl6->flowi6_flags & FLOWI_FLAG_SKIP_NH_OIF) &&
890 (fl6->flowi6_oif && fl6->flowi6_oif != dst->dev->ifindex))) {
889 dst_release(dst); 891 dst_release(dst);
890 dst = NULL; 892 dst = NULL;
891 } 893 }
@@ -1037,7 +1039,7 @@ struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
1037 if (final_dst) 1039 if (final_dst)
1038 fl6->daddr = *final_dst; 1040 fl6->daddr = *final_dst;
1039 if (!fl6->flowi6_oif) 1041 if (!fl6->flowi6_oif)
1040 fl6->flowi6_oif = dst->dev->ifindex; 1042 fl6->flowi6_oif = l3mdev_fib_oif(dst->dev);
1041 1043
1042 return xfrm_lookup_route(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); 1044 return xfrm_lookup_route(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0);
1043} 1045}