core: remove 'legacy_unstable_byteorder' argument from client-id helpers

The argument has no effect because the order only influences IAID
generation.
This commit is contained in:
Beniamino Galvani 2019-12-02 11:29:13 +01:00
parent 9c00eb5cb9
commit 4fcff3f34c
4 changed files with 7 additions and 17 deletions

View file

@ -8217,8 +8217,7 @@ dhcp4_get_client_id (NMDevice *self,
if (nm_streq (client_id, "duid")) { if (nm_streq (client_id, "duid")) {
guint32 iaid = dhcp_get_iaid (self, AF_INET, connection, NULL); guint32 iaid = dhcp_get_iaid (self, AF_INET, connection, NULL);
result = nm_utils_dhcp_client_id_systemd_node_specific (TRUE, result = nm_utils_dhcp_client_id_systemd_node_specific (iaid);
iaid);
goto out_good; goto out_good;
} }

View file

@ -3522,9 +3522,6 @@ nm_utils_create_dhcp_iaid (gboolean legacy_unstable_byteorder,
/** /**
* nm_utils_dhcp_client_id_systemd_node_specific_full: * 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 * @iaid: the IAID (identity association identifier) in native byte order
* @machine_id: the binary identifier for the machine. It is hashed * @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). * 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. * Returns: a %GBytes of generated client-id. This function cannot fail.
*/ */
GBytes * GBytes *
nm_utils_dhcp_client_id_systemd_node_specific_full (gboolean legacy_unstable_byteorder, nm_utils_dhcp_client_id_systemd_node_specific_full (guint32 iaid,
guint32 iaid,
const guint8 *machine_id, const guint8 *machine_id,
gsize machine_id_len) gsize machine_id_len)
{ {
@ -3578,11 +3574,9 @@ nm_utils_dhcp_client_id_systemd_node_specific_full (gboolean legacy_unstable_byt
} }
GBytes * GBytes *
nm_utils_dhcp_client_id_systemd_node_specific (gboolean legacy_unstable_byteorder, nm_utils_dhcp_client_id_systemd_node_specific (guint32 iaid)
guint32 iaid)
{ {
return nm_utils_dhcp_client_id_systemd_node_specific_full (legacy_unstable_byteorder, return nm_utils_dhcp_client_id_systemd_node_specific_full (iaid,
iaid,
(const guint8 *) nm_utils_machine_id_bin (), (const guint8 *) nm_utils_machine_id_bin (),
sizeof (NMUuid)); sizeof (NMUuid));
} }

View file

@ -388,13 +388,11 @@ guint32 nm_utils_create_dhcp_iaid (gboolean legacy_unstable_byteorder,
const guint8 *interface_id, const guint8 *interface_id,
gsize interface_id_len); gsize interface_id_len);
GBytes *nm_utils_dhcp_client_id_systemd_node_specific_full (gboolean legacy_unstable_byteorder, GBytes *nm_utils_dhcp_client_id_systemd_node_specific_full (guint32 iaid,
guint32 iaid,
const guint8 *machine_id, const guint8 *machine_id,
gsize machine_id_len); gsize machine_id_len);
GBytes *nm_utils_dhcp_client_id_systemd_node_specific (gboolean legacy_unstable_byteorder, GBytes *nm_utils_dhcp_client_id_systemd_node_specific (guint32 iaid);
guint32 iaid);
/*****************************************************************************/ /*****************************************************************************/

View file

@ -2087,8 +2087,7 @@ test_nm_utils_dhcp_client_id_systemd_node_specific (gconstpointer test_data)
guint32 tmp; guint32 tmp;
tmp = nm_utils_create_dhcp_iaid (TRUE, (const guint8 *) d->ifname, strlen (d->ifname)); 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, client_id = nm_utils_dhcp_client_id_systemd_node_specific_full (tmp,
tmp,
(const guint8 *) &d->machine_id, (const guint8 *) &d->machine_id,
sizeof (d->machine_id)); sizeof (d->machine_id));