mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 23:42:06 -04:00
361. [func] When the RBT find or chain functions set the name and
origin for a node that stores the root label the name is now set to an empty name, instead of ".", to simplify later use of the name and origin by dns_name_concatenate(), dns_name_totext() or dns_name_format(). 360. [func] dns_name_totext() and dns_name_format() now allow an empty name to be passed, which is formatted as "@".
This commit is contained in:
parent
36e0c37908
commit
c5944292e9
4 changed files with 36 additions and 36 deletions
10
CHANGES
10
CHANGES
|
|
@ -1,3 +1,13 @@
|
|||
361. [func] When the RBT find or chain functions set the name and
|
||||
origin for a node that stores the root label
|
||||
the name is now set to an empty name, instead of ".",
|
||||
to simplify later use of the name and origin by
|
||||
dns_name_concatenate(), dns_name_totext() or
|
||||
dns_name_format().
|
||||
|
||||
360. [func] dns_name_totext() and dns_name_format() now allow
|
||||
an empty name to be passed, which is formatted as "@".
|
||||
|
||||
359. [bug] dnssec-signzone occasionally signed glue records.
|
||||
|
||||
358. [cleanup] Rename the intermediate files used by the dnssec
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rbt_test.c,v 1.37 2000/07/31 22:33:59 tale Exp $ */
|
||||
/* $Id: rbt_test.c,v 1.38 2000/07/31 23:27:22 tale Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -26,6 +26,7 @@
|
|||
#include <isc/commandline.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#include <dns/rbt.h>
|
||||
#include <dns/fixedname.h>
|
||||
|
|
@ -88,7 +89,7 @@ static void
|
|||
delete_name(void *data, void *arg) {
|
||||
dns_name_t *name;
|
||||
|
||||
(void)arg;
|
||||
UNUSED(arg);
|
||||
name = data;
|
||||
isc_mem_put(mctx, data, sizeof(dns_name_t) + DNSNAMELEN);
|
||||
}
|
||||
|
|
@ -168,14 +169,7 @@ detail(dns_rbt_t *rbt, dns_name_t *name) {
|
|||
if (result == ISC_R_SUCCESS) {
|
||||
printf("\n name from dns_rbtnodechain_current: ");
|
||||
|
||||
/*
|
||||
* If foundname is absolute, it includes the origin (which
|
||||
* is intrinsically known here to be just ".").
|
||||
*/
|
||||
|
||||
result = dns_name_concatenate(foundname,
|
||||
dns_name_isabsolute(foundname) ?
|
||||
NULL : origin,
|
||||
result = dns_name_concatenate(foundname, origin,
|
||||
fullname, NULL);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
print_name(fullname);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rbt.h,v 1.44 2000/07/27 09:48:10 tale Exp $ */
|
||||
/* $Id: rbt.h,v 1.45 2000/07/31 23:27:25 tale Exp $ */
|
||||
|
||||
#ifndef DNS_RBT_H
|
||||
#define DNS_RBT_H 1
|
||||
|
|
@ -117,21 +117,17 @@ typedef isc_result_t (*dns_rbtfindcallback_t)(dns_rbtnode_t *node,
|
|||
* accomplished with a dns_fixedname_t. It is _not_ necessary to reinitialize
|
||||
* either 'name' or 'origin' between calls to the chain functions.
|
||||
*
|
||||
* NOTE WELL: the above rule means that when a chain points to the root of the
|
||||
* tree of trees and that root stores only the root label, ".", it means that
|
||||
* BOTH 'name' *and* 'origin' will be ".". As a common operation on
|
||||
* 'name' and 'origin' is to dns_name_concatenate them after they have been
|
||||
* set, special care must be taken to not concatenate 'name' if it is
|
||||
* dns_name_isabsolute(), which is only true in this special circumstance.
|
||||
* The logic behind having both 'name' and 'origin' be "." had to do with
|
||||
* zone file dumping. It is likely that dumping of "." will be handled
|
||||
* differently in the future and that the chain API will be changed such that
|
||||
* in the case of ".", only 'origin' will be "." and name will be set to
|
||||
* have zero labels.
|
||||
* NOTE WELL: even though the name data at the root of the tree of trees will
|
||||
* be absolute (typically just "."), it will will be made into a relative name
|
||||
* with an origin of "." -- an empty name when the node is ".". This is
|
||||
* because a common on operation on 'name' and 'origin' is to use
|
||||
* dns_name_concatenate() on them to generate the complete name. An empty name
|
||||
* can be detected when dns_name_countlabels == 0, and is printed by
|
||||
* dns_name_totext()/dns_name_format() as "@", consistent with RFC1035's
|
||||
* definition of "@" as the current origin.
|
||||
*
|
||||
* dns_rbtnodechain_current is similar to the _first, _last, _prev and _next
|
||||
* functions but additionally can provide the node to which the chain points.
|
||||
*/
|
||||
* functions but additionally can provide the node to which the chain points. */
|
||||
|
||||
/*
|
||||
* For use in allocating space for the chain of ancestor nodes.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rbt.c,v 1.88 2000/07/31 22:34:01 tale Exp $ */
|
||||
/* $Id: rbt.c,v 1.89 2000/07/31 23:27:24 tale Exp $ */
|
||||
|
||||
/* Principal Authors: DCL */
|
||||
|
||||
|
|
@ -1948,7 +1948,8 @@ dns_rbtnodechain_init(dns_rbtnodechain_t *chain, isc_mem_t *mctx) {
|
|||
|
||||
isc_result_t
|
||||
dns_rbtnodechain_current(dns_rbtnodechain_t *chain, dns_name_t *name,
|
||||
dns_name_t *origin, dns_rbtnode_t **node) {
|
||||
dns_name_t *origin, dns_rbtnode_t **node)
|
||||
{
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
|
||||
REQUIRE(VALID_CHAIN(chain));
|
||||
|
|
@ -1964,18 +1965,17 @@ dns_rbtnodechain_current(dns_rbtnodechain_t *chain, dns_name_t *name,
|
|||
|
||||
if (chain->level_count == 0) {
|
||||
/*
|
||||
* Eliminate the root name, except when name is ".".
|
||||
* Names in the top level tree are all absolute.
|
||||
* Always make 'name' relative.
|
||||
*/
|
||||
if (dns_name_countlabels(name) > 1) {
|
||||
INSIST(dns_name_isabsolute(name));
|
||||
INSIST(dns_name_isabsolute(name));
|
||||
|
||||
/*
|
||||
* XXX EVIL. But what _should_ I do?
|
||||
*/
|
||||
name->labels--;
|
||||
name->length--;
|
||||
name->attributes &= ~DNS_NAMEATTR_ABSOLUTE;
|
||||
}
|
||||
/*
|
||||
* This is cheaper than dns_name_getlabelsequence().
|
||||
*/
|
||||
name->labels--;
|
||||
name->length--;
|
||||
name->attributes &= ~DNS_NAMEATTR_ABSOLUTE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue