summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/sd-ipv4ll.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-05-23 18:33:17 +0200
committerLennart Poettering <lennart@poettering.net>2016-05-26 15:34:43 +0200
commit38958cd66e87037c75109408bf4093be21811eba (patch)
treec4e97d44b988f655003eefdb11bc9ff0d728865a /src/libsystemd-network/sd-ipv4ll.c
parentipv4acd: make sure our event handler callbacks never check uninitialized "r" ... (diff)
downloadsystemd-38958cd66e87037c75109408bf4093be21811eba.tar.xz
systemd-38958cd66e87037c75109408bf4093be21811eba.zip
ipv4ll: change "seed" parameter to be uint64_t
Let's make clear this always has the same size, since otherwise it's not useful for reproducible runs, which this is really about however.
Diffstat (limited to 'src/libsystemd-network/sd-ipv4ll.c')
-rw-r--r--src/libsystemd-network/sd-ipv4ll.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c
index 1f6da4bb16..0e6a9df9e5 100644
--- a/src/libsystemd-network/sd-ipv4ll.c
+++ b/src/libsystemd-network/sd-ipv4ll.c
@@ -144,9 +144,7 @@ int sd_ipv4ll_set_mac(sd_ipv4ll *ll, const struct ether_addr *addr) {
/* If no random data is set, generate some from the MAC */
seed = siphash24(&addr->ether_addr_octet, ETH_ALEN, HASH_KEY.bytes);
- assert_cc(sizeof(unsigned) <= 8);
-
- r = sd_ipv4ll_set_address_seed(ll, (unsigned) htole64(seed));
+ r = sd_ipv4ll_set_address_seed(ll, htole64(seed));
if (r < 0)
return r;
}
@@ -187,7 +185,7 @@ int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address) {
return 0;
}
-int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, unsigned seed) {
+int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, uint64_t seed) {
_cleanup_free_ struct random_data *random_data = NULL;
_cleanup_free_ char *random_data_state = NULL;
int r;
@@ -202,7 +200,7 @@ int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, unsigned seed) {
if (!random_data_state)
return -ENOMEM;
- r = initstate_r(seed, random_data_state, 128, random_data);
+ r = initstate_r((unsigned) seed, random_data_state, 128, random_data);
if (r < 0)
return r;