summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
diff options
context:
space:
mode:
authorDavid Ahern2019-04-06 01:30:29 +0200
committerDavid S. Miller2019-04-09 00:22:40 +0200
commit0f5f7d7bf6e6bda4dffe7b42812a16ada6ea9816 (patch)
tree20c54a4846f8631c1d2af99085fbdce2c44283ae /drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
parentipv4: Prepare fib_config for IPv6 gateway (diff)
downloadkernel-qcow2-linux-0f5f7d7bf6e6bda4dffe7b42812a16ada6ea9816.tar.gz
kernel-qcow2-linux-0f5f7d7bf6e6bda4dffe7b42812a16ada6ea9816.tar.xz
kernel-qcow2-linux-0f5f7d7bf6e6bda4dffe7b42812a16ada6ea9816.zip
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 'drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
index 133a497e3457..560a60e522f9 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
@@ -318,6 +318,9 @@ mlxsw_sp_span_gretap4_route(const struct net_device *to_dev,
*saddrp = fl4.saddr;
if (rt->rt_gw_family == AF_INET)
*daddrp = rt->rt_gw4;
+ /* can not offload if route has an IPv6 gateway */
+ else if (rt->rt_gw_family == AF_INET6)
+ dev = NULL;
out:
ip_rt_put(rt);