summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-lldp.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-06 14:02:10 +0300
committerLennart Poettering <lennart@poettering.net>2015-10-06 14:02:10 +0300
commit20d2f7851ac44bd6845d060a952461f5a10e9c87 (patch)
tree8fd714c7ffa680e3811361d6e5aa7d08f226247d /src/libsystemd-network/sd-lldp.c
parentc48eb61fa72205615e3a2bec9fb6576a5973fc6b (diff)
parent1e2527a6fede996a429bd44b30a15e76ee293437 (diff)
Merge pull request #1465 from teg/siphash24
hashmap/siphash24: refactor hash functions
Diffstat (limited to 'src/libsystemd-network/sd-lldp.c')
-rw-r--r--src/libsystemd-network/sd-lldp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libsystemd-network/sd-lldp.c b/src/libsystemd-network/sd-lldp.c
index 7aa405a655..06949a1e83 100644
--- a/src/libsystemd-network/sd-lldp.c
+++ b/src/libsystemd-network/sd-lldp.c
@@ -68,16 +68,14 @@ struct sd_lldp {
lldp_agent_statistics statistics;
};
-static unsigned long chassis_id_hash_func(const void *p,
- const uint8_t hash_key[HASH_KEY_SIZE]) {
- uint64_t u;
+static void chassis_id_hash_func(const void *p, struct siphash *state) {
const lldp_chassis_id *id = p;
assert(id);
+ assert(id->data);
- siphash24((uint8_t *) &u, id->data, id->length, hash_key);
-
- return (unsigned long) u;
+ siphash24_compress(&id->length, sizeof(id->length), state);
+ siphash24_compress(id->data, id->length, state);
}
static int chassis_id_compare_func(const void *_a, const void *_b) {