]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
commit rt17451
authorFrancis Dupont <fdupont@isc.org>
Mon, 31 Mar 2008 13:32:59 +0000 (13:32 +0000)
committerFrancis Dupont <fdupont@isc.org>
Mon, 31 Mar 2008 13:32:59 +0000 (13:32 +0000)
CHANGES
lib/dns/rbt.c

diff --git a/CHANGES b/CHANGES
index 6abb6db4154f933cd572618616e71a3dfe2f2b2d..a62b2a56ed307b0b24183d2bbbcd6fdb7e406865 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2347.  [bug]           Delete now traverses the RB tree in the canonical
+                       order. [RT #17451]
+
 2345.  [bug]           named-checkconf failed to detect when forwarders
                        were set at both the options/view level and in
                        a root zone. [RT #17671]
index c22c1f6360373e1f6c04e6457b45ed67b8ae734c..4d3ca3aa449e393ff7a7865443bbee660efd1fc7 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbt.c,v 1.128.18.9 2008/01/22 23:27:05 tbox Exp $ */
+/* $Id: rbt.c,v 1.128.18.10 2008/03/31 13:32:59 fdupont Exp $ */
 
 /*! \file */
 
@@ -2051,10 +2051,6 @@ dns_rbt_deletetreeflat(dns_rbt_t *rbt, unsigned int quantum,
                node = LEFT(node);
                goto traverse;
        }
-       if (RIGHT(node) != NULL) {
-               node = RIGHT(node);
-               goto traverse;
-       }
        if (DOWN(node) != NULL) {
                node = DOWN(node);
                goto traverse;
@@ -2071,14 +2067,15 @@ dns_rbt_deletetreeflat(dns_rbt_t *rbt, unsigned int quantum,
        node->magic = 0;
 #endif
        parent = PARENT(node);
+       if (RIGHT(node) != NULL)
+               PARENT(RIGHT(node)) = parent;
        if (parent != NULL) {
                if (LEFT(parent) == node)
-                       LEFT(parent) = NULL;
+                       LEFT(parent) = RIGHT(node);
                else if (DOWN(parent) == node)
-                       DOWN(parent) = NULL;
-               else if (RIGHT(parent) == node)
-                       RIGHT(parent) = NULL;
-       }
+                       DOWN(parent) = RIGHT(node);
+       } else
+               parent = RIGHT(node);
        isc_mem_put(rbt->mctx, node, NODE_SIZE(node));
        rbt->nodecount--;
        node = parent;