From fccb3e6c675d73784c5ef45e6dfd5c5e7e7e82f8 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 19 May 2000 05:58:48 +0000 Subject: [PATCH] When joining nodes, set parent pointers of the left and right children of the upper node (if they exist) to point to the new node. --- lib/dns/rbt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c index 49886b6c4e..9d9dd89848 100644 --- a/lib/dns/rbt.c +++ b/lib/dns/rbt.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: rbt.c,v 1.80 2000/05/19 04:42:08 tale Exp $ */ +/* $Id: rbt.c,v 1.81 2000/05/19 05:58:48 tale Exp $ */ /* Principal Authors: DCL */ @@ -1365,8 +1365,12 @@ join_nodes(dns_rbt_t *rbt, dns_rbtnode_t *node) { else RIGHT(PARENT(node)) = newnode; + if (LEFT(node) != NULL) + PARENT(LEFT(node)) = newnode; + if (RIGHT(node) != NULL) + PARENT(RIGHT(node)) = newnode; if (DOWN(down) != NULL) - PARENT(DOWN(down)) = newnode; + PARENT(DOWN(down)) = newnode; isc_mem_put(rbt->mctx, node, NODE_SIZE(node));