network: do not restart DHCPv4 client on stopping/restarting networkd

Follow-up for fc35a9f8d1 (v255).
Fixes #39299.
This commit is contained in:
Yu Watanabe
2025-10-31 17:59:22 +09:00
parent 31c220d8f5
commit b1ba55a8a7
+6
View 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;