]> www.infradead.org Git - users/hch/misc.git/commit
ipv6: Do not consider link down nexthops in path selection
authorIdo Schimmel <idosch@nvidia.com>
Wed, 2 Apr 2025 11:42:24 +0000 (14:42 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 4 Apr 2025 14:30:07 +0000 (07:30 -0700)
commit8b8e0dd357165e0258d9f9cdab5366720ed2f619
treec436cb7312bf097dc43b9939932a91c2e96b8b5c
parent4d0ab3a6885e3e9040310a8d8f54503366083626
ipv6: Do not consider link down nexthops in path selection

Nexthops whose link is down are not supposed to be considered during
path selection when the "ignore_routes_with_linkdown" sysctl is set.
This is done by assigning them a negative region boundary.

However, when comparing the computed hash (unsigned) with the region
boundary (signed), the negative region boundary is treated as unsigned,
resulting in incorrect nexthop selection.

Fix by treating the computed hash as signed. Note that the computed hash
is always in range of [0, 2^31 - 1].

Fixes: 3d709f69a3e7 ("ipv6: Use hash-threshold instead of modulo-N")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250402114224.293392-3-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/route.c