diff options
author | Enrico Loparco (eloparco) <eloparco@cisco.com> | 2021-06-18 14:32:44 +0200 |
---|---|---|
committer | Enrico Loparco (eloparco) <eloparco@cisco.com> | 2021-06-24 09:31:04 +0200 |
commit | 05bcac416bcddaf05bd0437bd27a19933502baf2 (patch) | |
tree | b34ef95bf3dffc27eabda12e055933703b9017bb /hicn-light/src/hicn/core/listener_table.h | |
parent | 4c5b811c7d105aafb847f9006fd1e5235206e5cd (diff) |
[HICN-709] Fix bugs in listener and connection tables and add unit tests
Signed-off-by: Enrico Loparco (eloparco) <eloparco@cisco.com>
Change-Id: Idf86a3c6a1dd50d29c1a245a00352a553a5fdb42
Diffstat (limited to 'hicn-light/src/hicn/core/listener_table.h')
-rw-r--r-- | hicn-light/src/hicn/core/listener_table.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hicn-light/src/hicn/core/listener_table.h b/hicn-light/src/hicn/core/listener_table.h index 91b68ee94..3d21cc88f 100644 --- a/hicn-light/src/hicn/core/listener_table.h +++ b/hicn-light/src/hicn/core/listener_table.h @@ -40,8 +40,8 @@ #define _lt_var(x) _lt_var_##x /* Hash functions for indices */ -#define key_hash(key) (hash(key, sizeof(listener_key_t))) -#define key_hash_eq(a, b) (key_hash(b) - key_hash(a)) +#define key_hash(key) (hash_struct(key)) +#define key_hash_eq(a, b) (key_hash(b) == key_hash(a)) /* Hash table types for indices */ KHASH_MAP_INIT_STR(lt_name, unsigned); @@ -72,7 +72,7 @@ typedef struct { */ #define listener_table_allocate(TABLE, LISTENER, KEY, NAME) \ do { \ - pool_get(table->listeners, (LISTENER)); \ + pool_get(TABLE->listeners, (LISTENER)); \ if (LISTENER) { \ off_t _lt_var(id) = (LISTENER) - (TABLE)->listeners; \ int _lt_var(res); \ |