From: Roy Marples Date: Tue, 30 Sep 2025 08:41:18 +0000 (+0100) Subject: route: Don't change them when exiting with persistence. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=195e8bdc38af6fa7936dc8435809ffd97c0b7075;p=thirdparty%2Fdhcpcd.git route: Don't change them when exiting with persistence. If an interface stops, it might affect the routing priority. When dhcpcd is exiting we want to avoid this behaviour to keep the system running as best as. --- diff --git a/src/route.c b/src/route.c index 57f9b187..a31c4f73 100644 --- a/src/route.c +++ b/src/route.c @@ -758,6 +758,12 @@ rt_build(struct dhcpcd_ctx *ctx, int af) struct rt *rt, *rtn; unsigned long long o; + /* When exiting with persistence, don't change any routing + * which maybe affected by interfaces stopping. */ + if ((ctx->options & (DHCPCD_EXITING | DHCPCD_PERSISTENT)) == + (DHCPCD_EXITING | DHCPCD_PERSISTENT)) + return; + rb_tree_init(&routes, &rt_compare_proto_ops); rb_tree_init(&added, &rt_compare_os_ops); rb_tree_init(&kroutes, &rt_compare_os_ops);