From: Mark Andrews Date: Wed, 1 Sep 2004 05:13:06 +0000 (+0000) Subject: 1708. [cleanup] Replaced dns_fullname_hash() with dns_name_fullhash() X-Git-Tag: v9.2.5rc1~81^2~31 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=d6fe7ba94969ee51a3f4298a735fbc6e11691ad8;p=thirdparty%2Fbind9.git 1708. [cleanup] Replaced dns_fullname_hash() with dns_name_fullhash() for conformance to the name space convention. Binary backward compatibility to the old function name is provided. [RT #12376] --- diff --git a/CHANGES b/CHANGES index 21d71395e1e..1d401b18737 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ 1709. [placeholder] rt12404 -1708. [placeholder] rt12376 +1708. [cleanup] Replaced dns_fullname_hash() with dns_name_fullhash() + for conformance to the name space convention. Binary + backward compatibility to the old function name is + provided. [RT #12376] 1707. [contrib] sdb/ldap updated to version 1.0-beta. diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 8ae10e0350b..8e41c96af94 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: adb.c,v 1.216 2004/06/18 01:22:32 marka Exp $ */ +/* $Id: adb.c,v 1.217 2004/09/01 05:13:04 marka Exp $ */ /* * Implementation notes @@ -1581,7 +1581,7 @@ find_name_and_lock(dns_adb_t *adb, dns_name_t *name, dns_adbname_t *adbname; int bucket; - bucket = dns_fullname_hash(name, ISC_FALSE) % NBUCKETS; + bucket = dns_name_fullhash(name, ISC_FALSE) % NBUCKETS; if (*bucketp == DNS_ADB_INVALIDBUCKET) { LOCK(&adb->namelocks[bucket]); diff --git a/lib/dns/include/dns/name.h b/lib/dns/include/dns/name.h index 111dde573a8..6f976ce7f4a 100644 --- a/lib/dns/include/dns/name.h +++ b/lib/dns/include/dns/name.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.h,v 1.109 2004/08/10 00:35:01 marka Exp $ */ +/* $Id: name.h,v 1.110 2004/09/01 05:13:06 marka Exp $ */ #ifndef DNS_NAME_H #define DNS_NAME_H 1 @@ -312,7 +312,7 @@ dns_name_hash(dns_name_t *name, isc_boolean_t case_sensitive); */ unsigned int -dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive); +dns_name_fullhash(dns_name_t *name, isc_boolean_t case_sensitive); /* * Provide a hash value for 'name'. Unlike dns_name_hash(), this function * always takes into account of the entire name to calculate the hash value. diff --git a/lib/dns/name.c b/lib/dns/name.c index 9e76f6c3b05..27110a93ed3 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.c,v 1.145 2004/04/19 21:47:43 marka Exp $ */ +/* $Id: name.c,v 1.146 2004/09/01 05:13:05 marka Exp $ */ #include @@ -179,6 +179,9 @@ static dns_name_t wild = /* XXXDCL make const? */ LIBDNS_EXTERNAL_DATA dns_name_t *dns_wildcardname = &wild; +unsigned int +dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive); + static void set_offsets(const dns_name_t *name, unsigned char *offsets, dns_name_t *set_name); @@ -430,7 +433,7 @@ dns_name_hash(dns_name_t *name, isc_boolean_t case_sensitive) { } unsigned int -dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive) { +dns_name_fullhash(dns_name_t *name, isc_boolean_t case_sensitive) { /* * Provide a hash value for 'name'. */ @@ -443,6 +446,18 @@ dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive) { name->length, case_sensitive)); } +unsigned int +dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive) { + /* + * This function was deprecated due to the breakage of the name space + * convention. We only keep this internally to provide binary backward + * compatibility. + */ + REQUIRE(VALID_NAME(name)); + + return (dns_name_fullhash(name, case_sensitive)); +} + unsigned int dns_name_hashbylabel(dns_name_t *name, isc_boolean_t case_sensitive) { unsigned char *offsets;