From: Yu Watanabe Date: Mon, 17 Feb 2025 17:08:10 +0000 (+0900) Subject: network/route: do not remove any foreign routes when KeepConfiguration=yes X-Git-Tag: v258-rc1~1313^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=724faccf45b6933bb30c56cf99acf6373fffbc70;p=thirdparty%2Fsystemd.git 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 #36411. --- diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index e41b4c31be1..9a05bf7c5cd 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1485,6 +1485,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;