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

diff --git a/CHANGES b/CHANGES
index ef0755e4e34b5406609d0c8a90f1dabed5065410..85d8033b5bf6a73e00d9e8f4a55e7b3861ef55e8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2347.  [bug]           Delete now traverses the RB tree in the canonical
+                       order. [RT #17451]
+
 2343.  [bug]           (Seemingly) duplicate IPv6 entries could be
                        created in ADB. [RT #17837]
 
index c48e42511575ed8e9bf900b67409667bb52acd63..e54916725c142160e3794d05ab45ed127a81bb2e 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbt.c,v 1.115.2.2.2.15 2008/01/22 23:26:40 tbox Exp $ */
+/* $Id: rbt.c,v 1.115.2.2.2.16 2008/03/31 13:37:44 fdupont Exp $ */
 
 /* Principal Authors: DCL */
 
@@ -2048,10 +2048,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;
@@ -2068,14 +2064,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;