From: Ido Schimmel Date: Tue, 17 Nov 2020 17:46:57 +0000 (+0200) Subject: mlxsw: spectrum_router: Set ifindex for IPv4 nexthops X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ff8a24182acc4558a979f04e7030514e97e552be;p=linux.git mlxsw: spectrum_router: Set ifindex for IPv4 nexthops The ifindex of the nexthop device was never set for IPv4 nexthops, unlike IPv6 nexthops. This went unnoticed since only IPv6 nexthops use it. Set the ifindex for IPv4 nexthops in order to be consistent with IPv6 and also because it will be used by a later patch. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 7dbf02f45913f..1ea338786479d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -3971,6 +3971,7 @@ static int mlxsw_sp_nexthop4_init(struct mlxsw_sp *mlxsw_sp, if (!dev) return 0; + nh->ifindex = dev->ifindex; rcu_read_lock(); in_dev = __in_dev_get_rcu(dev);