From bee0bb2b6835e04cc3b6939d5bbe0f9817404c30 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 7 May 1999 12:13:25 +0000 Subject: [PATCH] In join_nodes, when using the space of the down node, it needs to get the attributes of the joined name to correctly identify whether it is absolute. (IE, when the first level is joined with the top level, the node struct being used is from the first level, which is not absolute, but the new name is absolute so the struct needs to be updated.) --- lib/dns/rbt.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c index 3328de5f00..10a33af3d4 100644 --- a/lib/dns/rbt.c +++ b/lib/dns/rbt.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: rbt.c,v 1.52 1999/05/07 02:47:35 tale Exp $ */ +/* $Id: rbt.c,v 1.53 1999/05/07 12:13:25 tale Exp $ */ /* Principal Authors: DCL */ @@ -1292,7 +1292,7 @@ join_nodes(dns_rbt_t *rbt, */ newlength = newname->length + newname->labels; oldlength = NAMELEN(down) + OFFSETLEN(down); - if (newlength >= oldlength + PADBYTES(down)) + if (newlength > oldlength + PADBYTES(down)) result = create_node(rbt->mctx, newname, &newnode); else { @@ -1302,6 +1302,8 @@ join_nodes(dns_rbt_t *rbt, OFFSETLEN(down) = newname->labels; memcpy(OFFSETS(down), newname->offsets, newname->labels); + ATTRS(down) = newname->attributes; + newnode = down; result = DNS_R_SUCCESS; } @@ -1328,12 +1330,8 @@ join_nodes(dns_rbt_t *rbt, isc_mem_put(rbt->mctx, node, NODE_SIZE(node)); - if (newnode != down) { + if (newnode != down) isc_mem_put(rbt->mctx, down, NODE_SIZE(down)); -#if 0 - isc_mem_put(rbt->mctx, r.base, r.length); -#endif - } } return (result);