From: Yu Watanabe Date: Mon, 20 Oct 2025 02:36:40 +0000 (+0900) Subject: network: do not restart DHCPv4 client on stopping/restarting networkd X-Git-Tag: v259-rc1~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1ba55a8a7a69afb389b1c0791cb3ea49c858694;p=thirdparty%2Fsystemd.git network: do not restart DHCPv4 client on stopping/restarting networkd Follow-up for fc35a9f8d1632c4e7a279228f869bfc77d8f5b9c (v255). Fixes #39299. --- diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index bade74f3b09..f88e6d58fc1 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -1762,8 +1762,14 @@ int dhcp4_start_full(Link *link, bool set_ipv6_connectivity) { int r; assert(link); + assert(link->manager); assert(link->network); + /* On stopping/restarting networkd, we may drop IPv6 connectivity (which depends on KeepConfiguration= + * setting). Do not (re)start DHCPv4 client in that case. See issue #39299. */ + if (link->manager->state != MANAGER_RUNNING) + return 0; + if (!link->dhcp_client) return 0;