]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/route: fix condition in route_can_update()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 5 Jun 2024 08:59:28 +0000 (17:59 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 5 Jun 2024 12:04:52 +0000 (13:04 +0100)
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

index 3e0b25ff3deca1d9747b2e3620be64e7e3baf927..d596fd81e63cc73dd0d87298b29aba008d005e9d 100644 (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;