From 5a28c352a2f6de525f687c8869a2a4cb53bdb5e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Thu, 12 Apr 2012 14:14:22 +0300 Subject: authdb: ipv4 is in network order; not host order --- src/authdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/authdb.c b/src/authdb.c index ed309fe..8bbf372 100644 --- a/src/authdb.c +++ b/src/authdb.c @@ -155,9 +155,9 @@ void *authdb_get(struct authdb *adb, sockaddr_any *addr, struct authdb_entry *en return NULL; e = (unsigned char) b.ptr[0]; - b.ptr[0] = 0x00; + b.ptr[3] = 0x00; - hash = b.ptr[1] + b.ptr[2] + b.ptr[3]; + hash = b.ptr[0] + b.ptr[1] + b.ptr[2]; hash %= ARRAY_SIZE(adb->hash_bucket); for (me = adb->hash_bucket[hash]; me != NULL; me = me->next) { -- cgit v1.2.3