From a9182c89a666a9aa772c770c7f9f9ea39b98f328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 16 Jul 2020 17:30:44 +0200 Subject: [PATCH] Change the dns_name hashing to use 32-bit values 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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/dns/name.c b/lib/dns/name.c index 6b904e1822..46dee70781 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -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