Skip to content

Commit e5ec6a2

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_router: Fix IPv4 nexthop gateway indication
mlxsw needs to distinguish nexthops with a gateway from connected nexthops in order to write the former to the adjacency table of the device. The check used to rely on the fact that nexthops with a gateway have a 'link' scope whereas connected nexthops have a 'host' scope. This is no longer correct after commit 747c143 ("ip: fix dflt addr selection for connected nexthop"). Fix that by instead checking the address family of the gateway IP. This is a more direct way and also consistent with the IPv6 counterpart in mlxsw_sp_rt6_is_gateway(). Cc: [email protected] Fixes: 747c143 ("ip: fix dflt addr selection for connected nexthop") Fixes: 597cfe4 ("nexthop: Add support for IPv4 nexthops") Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Amit Cohen <[email protected]> Reviewed-by: Nicolas Dichtel <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c0f47c2 commit e5ec6a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5384,7 +5384,7 @@ static bool mlxsw_sp_fi_is_gateway(const struct mlxsw_sp *mlxsw_sp,
53845384
{
53855385
const struct fib_nh *nh = fib_info_nh(fi, 0);
53865386

5387-
return nh->fib_nh_scope == RT_SCOPE_LINK ||
5387+
return nh->fib_nh_gw_family ||
53885388
mlxsw_sp_nexthop4_ipip_type(mlxsw_sp, nh, NULL);
53895389
}
53905390

0 commit comments

Comments
 (0)