summaryrefslogtreecommitdiff
path: root/net/mpls
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2019-04-06 02:30:29 +0300
committerDavid S. Miller <davem@davemloft.net>2019-04-09 01:22:40 +0300
commit0f5f7d7bf6e6bda4dffe7b42812a16ada6ea9816 (patch)
tree20c54a4846f8631c1d2af99085fbdce2c44283ae /net/mpls
parentf35b794b3b405e2478654ea875bc0b29fe1a1bc5 (diff)
downloadlinux-0f5f7d7bf6e6bda4dffe7b42812a16ada6ea9816.tar.xz
ipv4: Add support to rtable for ipv6 gateway
Add support for an IPv6 gateway to rtable. Since a gateway is either IPv4 or IPv6, make it a union with rt_gw4 where rt_gw_family decides which address is in use. When dumping the route data, encode an ipv6 nexthop using RTA_VIA. Signed-off-by: David Ahern <dsahern@gmail.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mpls')
-rw-r--r--net/mpls/mpls_iptunnel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mpls/mpls_iptunnel.c b/net/mpls/mpls_iptunnel.c
index 1f61b4e53686..2619c2fbea93 100644
--- a/net/mpls/mpls_iptunnel.c
+++ b/net/mpls/mpls_iptunnel.c
@@ -141,8 +141,9 @@ static int mpls_xmit(struct sk_buff *skb)
if (rt->rt_gw_family == AF_INET)
err = neigh_xmit(NEIGH_ARP_TABLE, out_dev, &rt->rt_gw4,
skb);
- else
- err = -EAFNOSUPPORT;
+ else if (rt->rt_gw_family == AF_INET6)
+ err = neigh_xmit(NEIGH_ND_TABLE, out_dev, &rt->rt_gw6,
+ skb);
} else if (rt6) {
if (ipv6_addr_v4mapped(&rt6->rt6i_gateway)) {
/* 6PE (RFC 4798) */