aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2017-08-03 13:28:30 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-03 15:36:01 -0700
commitf36f5ac677d184a62404169c781339c0cc64ea87 (patch)
tree8484539919d7c58a2779386beb6ec4772c0eda61 /drivers/net/ethernet
parentmlxsw: spectrum_router: Add support for route replace (diff)
downloadlinux-dev-f36f5ac677d184a62404169c781339c0cc64ea87.tar.xz
linux-dev-f36f5ac677d184a62404169c781339c0cc64ea87.zip
mlxsw: spectrum_router: Abort on source-specific routes
Without resorting to ACLs, the device performs route lookup solely based on the destination IP address. In case source-specific routing is needed, an error is returned and the abort mechanism is activated, thus allowing the kernel to take over forwarding decisions. Instead of aborting, we can trap specific destination prefixes where source-specific routes are present, but this will result in a lot more code that is unlikely to ever be used. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index cded8e8039bd..45cf32ca4126 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -3528,6 +3528,9 @@ static int mlxsw_sp_router_fib6_add(struct mlxsw_sp *mlxsw_sp,
if (mlxsw_sp->router->aborted)
return 0;
+ if (rt->rt6i_src.plen)
+ return -EINVAL;
+
if (mlxsw_sp_fib6_rt_should_ignore(rt))
return 0;