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.
This commit is contained in:
Thomas Haller 2022-12-12 19:15:09 +01:00
parent 9073628bd6
commit 05ae48d64e
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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);