Skip to content

Commit f36f5ac

Browse files
idoschdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0a7fd1a commit f36f5ac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3528,6 +3528,9 @@ static int mlxsw_sp_router_fib6_add(struct mlxsw_sp *mlxsw_sp,
35283528
if (mlxsw_sp->router->aborted)
35293529
return 0;
35303530

3531+
if (rt->rt6i_src.plen)
3532+
return -EINVAL;
3533+
35313534
if (mlxsw_sp_fib6_rt_should_ignore(rt))
35323535
return 0;
35333536

0 commit comments

Comments
 (0)