diff options
author | 2017-04-15 09:15:45 +0000 | |
---|---|---|
committer | 2017-04-15 09:15:45 +0000 | |
commit | db7d0d02cdf695b4f3cbc8748a264162da703c76 (patch) | |
tree | c302a4ac1b7f2522b323ea4bebe14cb679a0a258 /usr.sbin/nsd/udb.c | |
parent | Fix format string in ACPI_MEMDEBUG block (diff) | |
download | wireguard-openbsd-db7d0d02cdf695b4f3cbc8748a264162da703c76.tar.xz wireguard-openbsd-db7d0d02cdf695b4f3cbc8748a264162da703c76.zip |
update to 4.1.16rc1
tests & OK sthen
(if there are more changes coming for 4.1.16 release we will just
commit them on top)
Diffstat (limited to 'usr.sbin/nsd/udb.c')
-rw-r--r-- | usr.sbin/nsd/udb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/nsd/udb.c b/usr.sbin/nsd/udb.c index 6ec17aec0b6..3e91c7c8b4c 100644 --- a/usr.sbin/nsd/udb.c +++ b/usr.sbin/nsd/udb.c @@ -427,8 +427,7 @@ grow_ram_hash(udb_base* udb, udb_ptr** newhash) void udb_base_link_ptr(udb_base* udb, udb_ptr* ptr) { - uint32_t i = chunk_hash_ptr(ptr->data) & udb->ram_mask; - assert((size_t)i < udb->ram_size); + uint32_t i; #ifdef UDB_CHECK assert(udb_valid_dataptr(udb, ptr->data)); /* must be to whole chunk*/ #endif @@ -441,6 +440,9 @@ void udb_base_link_ptr(udb_base* udb, udb_ptr* ptr) grow_ram_hash(udb, newram); } } + i = chunk_hash_ptr(ptr->data) & udb->ram_mask; + assert((size_t)i < udb->ram_size); + ptr->prev = NULL; ptr->next = udb->ram_hash[i]; udb->ram_hash[i] = ptr; |