diff options
author | Thomas Gschwantner <tharre3@gmail.com> | 2019-12-08 04:35:50 +0100 |
---|---|---|
committer | Thomas Gschwantner <tharre3@gmail.com> | 2019-12-11 06:22:17 +0100 |
commit | 360b9c8c8b4c4364b755dc0935f05e4ba4429cb0 (patch) | |
tree | f3012f1bf3e61239ec5be18edcb67780f5e2554e /lease.c | |
parent | Allow /32 and /128 to be omitted in ip= keys (diff) | |
download | wg-dynamic-360b9c8c8b4c4364b755dc0935f05e4ba4429cb0.tar.xz wg-dynamic-360b9c8c8b4c4364b755dc0935f05e4ba4429cb0.zip |
Use siphash for hashtables
Diffstat (limited to 'lease.c')
-rw-r--r-- | lease.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -32,7 +32,7 @@ static struct ipns ipns; static time_t gexpires = TIME_T_MAX; static bool synchronized; -KHASH_MAP_INIT_WGKEY(leaseht, struct wg_dynamic_lease *) +KHASH_MAP_INIT_SECURE_WGKEY(leaseht, struct wg_dynamic_lease *) khash_t(leaseht) *leases_ht = NULL; static time_t get_monotonic_time() @@ -67,6 +67,9 @@ void leases_init(const char *device_name, int interface_index, char *fname, synchronized = false; leases_ht = kh_init(leaseht); + if (!leases_ht) + fatal("kh_init()"); + ipp_init(&ipns); nlh = mnl_nlmsg_put_header(buf); |