From b1ba55a8a7a69afb389b1c0791cb3ea49c858694 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 20 Oct 2025 11:36:40 +0900 Subject: [PATCH] network: do not restart DHCPv4 client on stopping/restarting networkd Follow-up for fc35a9f8d1632c4e7a279228f869bfc77d8f5b9c (v255). Fixes #39299. --- src/network/networkd-dhcp4.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.47.3