summaryrefslogtreecommitdiffstats
path: root/authdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'authdb.c')
-rw-r--r--authdb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/authdb.c b/authdb.c
index 830bb94..304c03e 100644
--- a/authdb.c
+++ b/authdb.c
@@ -93,7 +93,7 @@ void authdb_close(struct authdb *adb)
for (i = 0; i < ARRAY_SIZE(adb->hash_bucket); i++) {
for (c = adb->hash_bucket[i]; c != NULL; c = n) {
n = c->next;
- authdb_me_free(n);
+ authdb_me_free(c);
}
}
}
@@ -156,7 +156,9 @@ void *authdb_get(struct authdb *adb, sockaddr_any *addr, struct authdb_entry *en
e = b.ptr[0];
b.ptr[0] = 0x00;
+
hash = b.ptr[1] + b.ptr[2] + b.ptr[3];
+ hash %= ARRAY_SIZE(adb->hash_bucket);
for (me = adb->hash_bucket[hash]; me != NULL; me = me->next) {
if (addr_cmp(&baseaddr, &me->baseaddr) == 0)