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 747c14307214 ("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().
Unified · Split
| @@ -5384,7 +5384,7 @@ static bool mlxsw_sp_fi_is_gateway(const struct mlxsw_sp *mlxsw_sp, · 5383 unmodified lines | |||
| 5384 | { | 5384 | { |
| 5385 | const struct fib_nh *nh = fib_info_nh(fi, 0); | 5385 | const struct fib_nh *nh = fib_info_nh(fi, 0); |
| 5386 | 5386 | ||
| 5387 | return nh->fib_nh_scope == RT_SCOPE_LINK || | 5387 | return nh->fib_nh_gw_family || |
| 5388 | mlxsw_sp_nexthop4_ipip_type(mlxsw_sp, nh, NULL); | 5388 | mlxsw_sp_nexthop4_ipip_type(mlxsw_sp, nh, NULL); |
| 5389 | } | 5389 | } |
| 5390 | 5390 | ||