diff options
author | Daniel Mack <daniel@zonque.org> | 2015-11-16 23:17:52 +0100 |
---|---|---|
committer | Daniel Mack <daniel@zonque.org> | 2015-11-16 23:17:52 +0100 |
commit | 933f9caeeb2b3c1b951d330e04beb04226e5a890 (patch) | |
tree | dc36a6ddd84b060590c4885db7b6c3e9e91081eb /src/libsystemd-network/sd-ipv4ll.c | |
parent | 5cd6491b71008334daa9965464e038dc3e39948a (diff) |
siphash24: let siphash24_finalize() and siphash24() return the result directly
Rather than passing a pointer to return the result, return it directly
from the function calls.
Also, return the result in native endianess, and let the callers care
about the conversion. For hash tables and bloom filters, we don't care,
but in order to keep MAC addresses and DHCP client IDs stable, we
explicitly convert to LE.
Diffstat (limited to 'src/libsystemd-network/sd-ipv4ll.c')
-rw-r--r-- | src/libsystemd-network/sd-ipv4ll.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index e69b1864d7..006db6feee 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -146,12 +146,11 @@ int sd_ipv4ll_set_mac(sd_ipv4ll *ll, const struct ether_addr *addr) { uint64_t seed; /* If no random data is set, generate some from the MAC */ - siphash24(&seed, &addr->ether_addr_octet, - ETH_ALEN, HASH_KEY.bytes); + seed = siphash24(&addr->ether_addr_octet, ETH_ALEN, HASH_KEY.bytes); assert_cc(sizeof(unsigned) <= 8); - r = sd_ipv4ll_set_address_seed(ll, (unsigned)seed); + r = sd_ipv4ll_set_address_seed(ll, (unsigned) htole64(seed)); if (r < 0) return r; } |