]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Change the dns_name hashing to use 32-bit values
authorOndřej Surý <ondrej@isc.org>
Thu, 16 Jul 2020 15:30:44 +0000 (17:30 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 21 Jul 2020 06:44:26 +0000 (08:44 +0200)
Change the dns_hash_name() and dns_hash_fullname() functions to use
isc_hash32() as the maximum hashtable size in rbt is 0..UINT32_MAX
large.

lib/dns/name.c

index 6b904e1822f98d4c65d3bd6dc4e1d58376ae8010..46dee7078180ed990fcac647d2c3196e976e6480 100644 (file)
@@ -465,7 +465,7 @@ dns_name_hash(const dns_name_t *name, bool case_sensitive) {
        }
 
        /* High bits are more random. */
-       return (isc_hash_function(name->ndata, length, case_sensitive) >> 32);
+       return (isc_hash32(name->ndata, length, case_sensitive));
 }
 
 unsigned int
@@ -480,8 +480,7 @@ dns_name_fullhash(const dns_name_t *name, bool case_sensitive) {
        }
 
        /* High bits are more random. */
-       return (isc_hash_function(name->ndata, name->length, case_sensitive) >>
-               32);
+       return (isc_hash32(name->ndata, name->length, case_sensitive));
 }
 
 dns_namereln_t