]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: route: do not drop unreachable route on reconfiguring downstream interface
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 18 Dec 2021 00:46:55 +0000 (09:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 18 Dec 2021 01:09:07 +0000 (10:09 +0900)
Previously, when a downstream is reconfigured, the unreachable route
was removed as there is no corresponding static config in .network
files.

src/network/networkd-route.c

index 156476066a31397d9a066005ad9db0a4a04744ee..d7fb9094faf4d93dda98a44768d41fb31d033368 100644 (file)
@@ -792,6 +792,10 @@ static void manager_mark_routes(Manager *manager, bool foreign, const Link *exce
                 if (foreign && route->source != NETWORK_CONFIG_SOURCE_FOREIGN)
                         continue;
 
+                /* Do not touch dynamic routes. They will removed by dhcp_pd_prefix_lost() */
+                if (IN_SET(route->source, NETWORK_CONFIG_SOURCE_DHCP4, NETWORK_CONFIG_SOURCE_DHCP6))
+                        continue;
+
                 /* Ignore routes not assigned yet or already removed. */
                 if (!route_exists(route))
                         continue;