From ac940fef1be5e18a843499bcb58c67bb7316547f Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Fri, 19 May 2000 21:27:14 +0000 Subject: [PATCH] [RT #115] find_closest_nxt() tried to concatenate . with . when the closest NXT was owned by the root domain --- lib/dns/rbtdb.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index d481c8673d..546e78a106 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -1424,6 +1424,13 @@ find_wildcard(rbtdb_search_t *search, dns_rbtnode_t **nodep) { return (result); } +static inline isc_boolean_t +rootname(dns_name_t *name) { + if (dns_name_countlabels(name) == 1 && dns_name_isabsolute(name)) + return (ISC_TRUE); + return (ISC_FALSE); +} + static inline isc_result_t find_closest_nxt(rbtdb_search_t *search, dns_dbnode_t **nodep, dns_name_t *foundname, dns_rdataset_t *rdataset, @@ -1504,6 +1511,8 @@ find_closest_nxt(rbtdb_search_t *search, dns_dbnode_t **nodep, * that we're looking at one. For now, we * do nothing. */ + if (rootname(name)) + origin = NULL; result = dns_name_concatenate(name, origin, foundname, NULL); @@ -4460,13 +4469,6 @@ dbiterator_next(dns_dbiterator_t *iterator) { return (result); } -static inline isc_boolean_t -rootname(dns_name_t *name) { - if (dns_name_countlabels(name) == 1 && dns_name_isabsolute(name)) - return (ISC_TRUE); - return (ISC_FALSE); -} - static isc_result_t dbiterator_current(dns_dbiterator_t *iterator, dns_dbnode_t **nodep, dns_name_t *name)