Skip to content
Snippets Groups Projects
Commit 8c0cd07c authored by Ivan Vecera's avatar Ivan Vecera
Browse files

mlxsw: spectrum_router: Fix IPv4 nexthop gateway indication

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2140704



commit e5ec6a25
Author: Ido Schimmel <idosch@nvidia.com>
Date:   Tue Jul 19 15:26:26 2022 +0300

    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 747c1430 ("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: stable@vger.kernel.org
    Fixes: 747c1430 ("ip: fix dflt addr selection for connected nexthop")
    Fixes: 597cfe4f ("nexthop: Add support for IPv4 nexthops")
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reviewed-by: default avatarAmit Cohen <amcohen@nvidia.com>
Reviewed-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>

Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
parent 711e06ad
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment