From f4bc158a468faf6a295ea6bbff496b7c6c3203f8 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Tue, 8 Aug 2000 23:18:12 +0000 Subject: [PATCH] in dns_name_isabsolute(), dns_name_fullcompare(), and dns_name_compare(), do not require that the name has >0 labels so that these functions can be used on the degenerate relative name @ --- lib/dns/include/dns/name.h | 12 +----------- lib/dns/name.c | 5 +---- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/dns/include/dns/name.h b/lib/dns/include/dns/name.h index 2d22d5f48d..33d5b5dd4e 100644 --- a/lib/dns/include/dns/name.h +++ b/lib/dns/include/dns/name.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.h,v 1.78 2000/08/01 01:24:22 tale Exp $ */ +/* $Id: name.h,v 1.79 2000/08/08 23:18:12 gson Exp $ */ #ifndef DNS_NAME_H #define DNS_NAME_H 1 @@ -335,8 +335,6 @@ dns_name_isabsolute(const dns_name_t *name); * Requires: * 'name' is a valid name * - * dns_name_countlabels(name) > 0 - * * Returns: * TRUE The last label in 'name' is the root label. * FALSE The last label in 'name' is not the root label. @@ -454,12 +452,8 @@ dns_name_compare(const dns_name_t *name1, const dns_name_t *name2); * Requires: * 'name1' is a valid name * - * dns_name_countlabels(name1) > 0 - * * 'name2' is a valid name * - * dns_name_countlabels(name2) > 0 - * * Either name1 is absolute and name2 is absolute, or neither is. * * Returns: @@ -534,12 +528,8 @@ dns_name_issubdomain(const dns_name_t *name1, const dns_name_t *name2); * Requires: * 'name1' is a valid name * - * dns_name_countlabels(name1) > 0 - * * 'name2' is a valid name * - * dns_name_countlabels(name2) > 0 - * * Either name1 is absolute and name2 is absolute, or neither is. * * Returns: diff --git a/lib/dns/name.c b/lib/dns/name.c index ccb91d30c6..463609dc44 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.c,v 1.100 2000/08/01 01:22:33 tale Exp $ */ +/* $Id: name.c,v 1.101 2000/08/08 23:18:10 gson Exp $ */ #include @@ -383,7 +383,6 @@ dns_name_isabsolute(const dns_name_t *name) { */ REQUIRE(VALID_NAME(name)); - REQUIRE(name->labels > 0); if ((name->attributes & DNS_NAMEATTR_ABSOLUTE) != 0) return (ISC_TRUE); @@ -509,9 +508,7 @@ dns_name_fullcompare(const dns_name_t *name1, const dns_name_t *name2, */ REQUIRE(VALID_NAME(name1)); - REQUIRE(name1->labels > 0); REQUIRE(VALID_NAME(name2)); - REQUIRE(name2->labels > 0); REQUIRE(orderp != NULL); REQUIRE(nlabelsp != NULL); REQUIRE(nbitsp != NULL);