]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix hashmap part of load-names benchmark
authorOndřej Surý <ondrej@isc.org>
Fri, 6 Oct 2023 08:28:32 +0000 (10:28 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 9 Oct 2023 19:04:21 +0000 (21:04 +0200)
The name_match() was errorneously converting struct item into dns_name
pointer.  Correctly retype void *node to struct item * first and then
use item.fixed.name to pass the name to dns_name_equal() function.

tests/bench/load-names.c

index 752d7e8b58b7f9b9a4147b02df5d79011ca6e31e..0e5512e69b56d47c2b62ee2e834abef2f30d5249 100644 (file)
@@ -190,7 +190,8 @@ new_hashmap(isc_mem_t *mem) {
 
 static bool
 name_match(void *node, const void *key) {
-       return (dns_name_equal(node, key));
+       const struct item_s *i = node;
+       return (dns_name_equal(&i->fixed.name, key));
 }
 
 static isc_result_t