From: Yu Watanabe Date: Wed, 5 Jun 2024 08:59:28 +0000 (+0900) Subject: network/route: fix condition in route_can_update() X-Git-Tag: v256-rc4~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b439af2c0cbe1e457fdf008eb92da42cd90546b;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 3e0b25ff3de..d596fd81e63 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -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;