summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/dhcp-identifier.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-11-01 14:43:11 +0100
committerThomas Haller <thaller@redhat.com>2018-11-12 19:08:35 +0100
commit6d13616b9e97743b45794deb892b28b4d6ab1835 (patch)
treefdd2ee10c0c096b80dfef769e1dd416976af1bda /src/libsystemd-network/dhcp-identifier.h
parent43fc095532899121030750204f47ab8566514d90 (diff)
downloadsystemd-6d13616b9e97743b45794deb892b28b4d6ab1835.tar.gz
dhcp: support endianness independent dhcp_identifier_set_iaid()
The previous code did htole64() followed by unaligned_write_be32() (the XOR and shift in between is endianness agnostic). That means, on every architeture there is always exactly one byte swap and the iaid is dependent on endianness. Since dhcp_identifier_set_iaid() is part of the DUID generation algorithm, this cannot be fixed without changing the client-id. In particular, as the client-id already depends on the machine-id (and is thus inherrently host-specific), it is better to stick to the current behavior. However, add a parameter to switch between old and new behaviour. Since the new behavior is unused, the only real purpose of this change is to self-document the oddity of the function. Fixes: 933f9caeeb2b3c1b951d330e04beb04226e5a890
Diffstat (limited to 'src/libsystemd-network/dhcp-identifier.h')
-rw-r--r--src/libsystemd-network/dhcp-identifier.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/dhcp-identifier.h b/src/libsystemd-network/dhcp-identifier.h
index 64315d3a3b..a544f38ab8 100644
--- a/src/libsystemd-network/dhcp-identifier.h
+++ b/src/libsystemd-network/dhcp-identifier.h
@@ -57,4 +57,4 @@ int dhcp_identifier_set_duid_llt(struct duid *duid, usec_t t, const uint8_t *add
int dhcp_identifier_set_duid_ll(struct duid *duid, const uint8_t *addr, size_t addr_len, uint16_t arp_type, size_t *len);
int dhcp_identifier_set_duid_en(struct duid *duid, size_t *len);
int dhcp_identifier_set_duid_uuid(struct duid *duid, size_t *len);
-int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, void *_id);
+int dhcp_identifier_set_iaid(int ifindex, const uint8_t *mac, size_t mac_len, bool legacy_unstable_byteorder, void *_id);