]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: Use RTNH_COMPARE_MASK in route_can_update() (#36585)
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 3 Mar 2025 20:00:33 +0000 (21:00 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 4 Mar 2025 21:28:53 +0000 (21:28 +0000)
Let's only compare flags that can be set by userspace and not all flags.

Fixes a bug introduced by 7027cdbd79c26d5a8890759a37d70165c8aeb214 (v256).
Fixes #36544

(cherry picked from commit 9fd25fd3ce4012e737688f0f1f3400c3e21c99f7)

src/network/networkd-route.c

index 35c983b4a5b53a86a1d642cf758c9a76fc07286d..9a506b11b708734de8eac646caf69c86f2302098 100644 (file)
@@ -1409,7 +1409,7 @@ bool route_can_update(const Route *existing, const Route *requesting) {
                         return false;
                 if (existing->type != requesting->type)
                         return false;
-                if (existing->flags != requesting->flags)
+                if ((existing->flags & ~RTNH_COMPARE_MASK) != (requesting->flags & ~RTNH_COMPARE_MASK))
                         return false;
                 if (!in6_addr_equal(&existing->prefsrc.in6, &requesting->prefsrc.in6))
                         return false;