network/route: fix condition in route_can_update()

An existing route with lifetime can be always updated with a new
finite lifetime. As the comment in the code says, we cannot disable the
lifetime. So, the condition must be '==', rather than '!='.

Fixes #33210.
This commit is contained in:
Yu Watanabe 2024-06-05 17:59:28 +09:00 committed by Luca Boccassi
parent 3523d28b97
commit 8b439af2c0

View file

@ -1320,7 +1320,7 @@ bool route_can_update(const Route *existing, const Route *requesting) {
return false;
if (existing->pref != requesting->pref)
return false;
if (existing->expiration_managed_by_kernel && requesting->lifetime_usec != USEC_INFINITY)
if (existing->expiration_managed_by_kernel && requesting->lifetime_usec == USEC_INFINITY)
return false; /* We cannot disable expiration timer in the kernel. */
if (!route_metric_can_update(&existing->metric, &requesting->metric, existing->expiration_managed_by_kernel))
return false;