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

network/route: do not remove any foreign routes when KeepConfiguration=yes

Without this change, only foreign routes with RTPROT_KERNEL, RTPROT_STATIC,
RTPROT_DHCP, RTPROT_RA, and RTPROT_REDIRECT are kept, and foreign routes with
other protocol e.g. RTPROT_BOOT are removed even if KeepConfiguration=yes.

Fixes a regression in dd6d53a8dc58c5e6e310b09ba7f7a22600a87ba9 (v257).
Fixes .

(cherry picked from commit 724faccf45b6933bb30c56cf99acf6373fffbc70)
This commit is contained in:
Yu Watanabe 2025-02-18 02:08:10 +09:00 committed by Daan De Meyer
parent 575c975842
commit 39e68c03c8

@ -1481,6 +1481,9 @@ int link_drop_routes(Link *link, bool only_static) {
continue;
if (route->source == NETWORK_CONFIG_SOURCE_FOREIGN && link->network) {
if (FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_YES))
continue;
if (route->protocol == RTPROT_STATIC &&
FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_STATIC))
continue;