]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not restart DHCPv4 client on stopping/restarting networkd
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 20 Oct 2025 02:36:40 +0000 (11:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 31 Oct 2025 08:59:22 +0000 (17:59 +0900)
Follow-up for fc35a9f8d1632c4e7a279228f869bfc77d8f5b9c (v255).
Fixes #39299.

src/network/networkd-dhcp4.c

index bade74f3b0930b71fb1f09e9f8950d46761f37dd..f88e6d58fc12c84391fa2714eb6a4404ef8b873f 100644 (file)
@@ -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;