From 05ae48d64e3e5afd2fc8433ac965bc61b0a1f647 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 12 Dec 2022 19:15:09 +0100 Subject: [PATCH] dhcp: don't use nm_dhcp_client_get_effective_client_id() from systemd DHCPv6 client The "effective-client-id" is handled wrongly. Step 1 to clean this up. Note that NMDhcpClientPrivate.effective_client_id is only ever get/set via the nm_dhcp_client_[gs]et_effective_client_id() functions. Note that only a NMDhcpDhclient instance ever calls nm_dhcp_client_set_effective_client_id(). Hence, for NMDhcpSystemd the effective-client-id is really just the DUID from the config. Clean this up by not calling nm_dhcp_client_get_effective_client_id() but use the config directly. There is no change in behavior here. --- src/core/dhcp/nm-dhcp-systemd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/dhcp/nm-dhcp-systemd.c b/src/core/dhcp/nm-dhcp-systemd.c index ff83cec574..3b6ba96d48 100644 --- a/src/core/dhcp/nm-dhcp-systemd.c +++ b/src/core/dhcp/nm-dhcp-systemd.c @@ -271,7 +271,7 @@ ip6_start(NMDhcpClient *client, const struct in6_addr *ll_addr, GError **error) /* TODO: honor nm_dhcp_client_get_anycast_address() */ - duid = nm_dhcp_client_get_effective_client_id(client); + duid = client_config->client_id; if (!duid || !(duid_arr = g_bytes_get_data(duid, &duid_len)) || duid_len < 2) { nm_utils_error_set_literal(error, NM_UTILS_ERROR_UNKNOWN, "missing DUID"); g_return_val_if_reached(FALSE);