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 dd6d53a8dc (v257).
Fixes #36411.
This commit is contained in:
Yu Watanabe
2025-02-18 23:01:53 +09:00
parent fff6dfc75e
commit 724faccf45
+3
View File
@@ -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;