1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-21 02:50:18 +03:00

network: Use RTNH_COMPARE_MASK in route_can_update() (#36585)

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)
This commit is contained in:
Daan De Meyer 2025-03-03 21:00:33 +01:00 committed by Luca Boccassi
parent 11da52785c
commit edfb2eb497

View 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;