From 348af3aa3005ee0b43f9bfed33a14c00c990a035 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Sat, 30 May 2026 22:07:45 +0200 Subject: [PATCH] dhcp/nettools: don't clear effective client-id on restart When ip4_start() is called after a restart (priv->client already exists), nettools_create() is skipped so effective_client_id stays NULL. The unconditional nm_dhcp_client_set_effective_client_id() call then clears the client-id that was properly set during the initial start. Only update the effective client-id when it was actually obtained from nettools_create(). Fixes: 1db882ca63a5 ('dhcp: allow the plugin to be restarted') --- src/core/dhcp/nm-dhcp-nettools.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/dhcp/nm-dhcp-nettools.c b/src/core/dhcp/nm-dhcp-nettools.c index 35d71e8b55..97f0d33d4d 100644 --- a/src/core/dhcp/nm-dhcp-nettools.c +++ b/src/core/dhcp/nm-dhcp-nettools.c @@ -1525,7 +1525,8 @@ ip4_start(NMDhcpClient *client, GError **error) _LOGT("dhcp-client4: start " NM_HASH_OBFUSCATE_PTR_FMT, NM_HASH_OBFUSCATE_PTR(priv->client)); - nm_dhcp_client_set_effective_client_id(client, effective_client_id); + if (effective_client_id) + nm_dhcp_client_set_effective_client_id(client, effective_client_id); return TRUE; }