From 8b439af2c0cbe1e457fdf008eb92da42cd90546b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 5 Jun 2024 17:59:28 +0900 Subject: [PATCH] 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. --- src/network/networkd-route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3