summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-dhcp-server.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-10-06 15:04:42 +0200
committerTom Gundersen <teg@jklm.no>2015-10-06 17:47:00 +0200
commit0cb3c286883b694fc52a18a3b559ff98931641f3 (patch)
treef8c3cf9104b3ea8fc180bd1de1e72119dfe4524e /src/libsystemd-network/test-dhcp-server.c
parent8c60d978bd3453659bfa7f4d90a17ba5fa3e0774 (diff)
siphash24: unify API
Make the API of the new helpers more similar to the old wrapper. In particular we now return the hash as a byte string to avoid any endianness problems.
Diffstat (limited to 'src/libsystemd-network/test-dhcp-server.c')
-rw-r--r--src/libsystemd-network/test-dhcp-server.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libsystemd-network/test-dhcp-server.c b/src/libsystemd-network/test-dhcp-server.c
index 01205efc18..c3bcb9cb4b 100644
--- a/src/libsystemd-network/test-dhcp-server.c
+++ b/src/libsystemd-network/test-dhcp-server.c
@@ -200,10 +200,13 @@ static void test_message_handler(void) {
static uint64_t client_id_hash_helper(DHCPClientId *id, uint8_t key[HASH_KEY_SIZE]) {
struct siphash state;
+ uint64_t hash;
- siphash_init(&state, key);
+ siphash24_init(&state, key);
client_id_hash_func(id, &state);
- return siphash24_finalize(&state);
+ siphash24_finalize((uint8_t*)&hash, &state);
+
+ return hash;
}
static void test_client_id_hash(void) {