From 4fcff3f34ca61610f00cd30926d5e0d36db6271f Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 2 Dec 2019 11:29:13 +0100 Subject: [PATCH] core: remove 'legacy_unstable_byteorder' argument from client-id helpers The argument has no effect because the order only influences IAID generation. --- src/devices/nm-device.c | 3 +-- src/nm-core-utils.c | 12 +++--------- src/nm-core-utils.h | 6 ++---- src/tests/test-core.c | 3 +-- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index ba7cb010b4..c4e7b80c69 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -8217,8 +8217,7 @@ dhcp4_get_client_id (NMDevice *self, if (nm_streq (client_id, "duid")) { guint32 iaid = dhcp_get_iaid (self, AF_INET, connection, NULL); - result = nm_utils_dhcp_client_id_systemd_node_specific (TRUE, - iaid); + result = nm_utils_dhcp_client_id_systemd_node_specific (iaid); goto out_good; } diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index a5394c9e55..fb92289f0d 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c @@ -3522,9 +3522,6 @@ nm_utils_create_dhcp_iaid (gboolean legacy_unstable_byteorder, /** * nm_utils_dhcp_client_id_systemd_node_specific_full: - * @legacy_unstable_byteorder: historically, the code would generate a iaid - * dependent on host endianness. This is undesirable, if backward compatibility - * are not a concern, generate stable endianness. * @iaid: the IAID (identity association identifier) in native byte order * @machine_id: the binary identifier for the machine. It is hashed * into the DUID. It commonly is /etc/machine-id (parsed in binary as NMUuid). @@ -3537,8 +3534,7 @@ nm_utils_create_dhcp_iaid (gboolean legacy_unstable_byteorder, * Returns: a %GBytes of generated client-id. This function cannot fail. */ GBytes * -nm_utils_dhcp_client_id_systemd_node_specific_full (gboolean legacy_unstable_byteorder, - guint32 iaid, +nm_utils_dhcp_client_id_systemd_node_specific_full (guint32 iaid, const guint8 *machine_id, gsize machine_id_len) { @@ -3578,11 +3574,9 @@ nm_utils_dhcp_client_id_systemd_node_specific_full (gboolean legacy_unstable_byt } GBytes * -nm_utils_dhcp_client_id_systemd_node_specific (gboolean legacy_unstable_byteorder, - guint32 iaid) +nm_utils_dhcp_client_id_systemd_node_specific (guint32 iaid) { - return nm_utils_dhcp_client_id_systemd_node_specific_full (legacy_unstable_byteorder, - iaid, + return nm_utils_dhcp_client_id_systemd_node_specific_full (iaid, (const guint8 *) nm_utils_machine_id_bin (), sizeof (NMUuid)); } diff --git a/src/nm-core-utils.h b/src/nm-core-utils.h index a1c57d7c77..7d63d06afc 100644 --- a/src/nm-core-utils.h +++ b/src/nm-core-utils.h @@ -388,13 +388,11 @@ guint32 nm_utils_create_dhcp_iaid (gboolean legacy_unstable_byteorder, const guint8 *interface_id, gsize interface_id_len); -GBytes *nm_utils_dhcp_client_id_systemd_node_specific_full (gboolean legacy_unstable_byteorder, - guint32 iaid, +GBytes *nm_utils_dhcp_client_id_systemd_node_specific_full (guint32 iaid, const guint8 *machine_id, gsize machine_id_len); -GBytes *nm_utils_dhcp_client_id_systemd_node_specific (gboolean legacy_unstable_byteorder, - guint32 iaid); +GBytes *nm_utils_dhcp_client_id_systemd_node_specific (guint32 iaid); /*****************************************************************************/ diff --git a/src/tests/test-core.c b/src/tests/test-core.c index 2148fe7167..c6769cd8a2 100644 --- a/src/tests/test-core.c +++ b/src/tests/test-core.c @@ -2087,8 +2087,7 @@ test_nm_utils_dhcp_client_id_systemd_node_specific (gconstpointer test_data) guint32 tmp; tmp = nm_utils_create_dhcp_iaid (TRUE, (const guint8 *) d->ifname, strlen (d->ifname)); - client_id = nm_utils_dhcp_client_id_systemd_node_specific_full (legacy_unstable_byteorder, - tmp, + client_id = nm_utils_dhcp_client_id_systemd_node_specific_full (tmp, (const guint8 *) &d->machine_id, sizeof (d->machine_id));