]> 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>
Thu, 30 Jul 2020 09:57:24 +0000 (11:57 +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.

(cherry picked from commit a9182c89a666a9aa772c770c7f9f9ea39b98f328)

lib/dns/name.c

index fb1b2738f03bff29d96acac8509a3daac3d40ace..b83453af8e7e9cd9e25bbb257e8deca7f3d74326 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