]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fix incorrect implementation of the third pass
authorIgor Putovny <igor.putovny@nic.cz>
Fri, 6 Oct 2023 12:19:04 +0000 (14:19 +0200)
committerIgor Putovny <igor.putovny@nic.cz>
Thu, 30 May 2024 10:30:00 +0000 (12:30 +0200)
proto/aggregator/aggregator.c

index 5bd89a65ce5eec9465c7ceeb2b3073733668f91e..d8f1685154dca934e35cf1de45f879efeea9cb29 100644 (file)
@@ -470,6 +470,7 @@ third_pass(struct trie_node *node)
   {
     assert(node->potential_buckets_count > 0);
     node->bucket = node->potential_buckets[0];
+    goto descent;
   }
 
   const struct aggregator_bucket *inherited_bucket = get_ancestor_bucket(node);
@@ -490,8 +491,9 @@ third_pass(struct trie_node *node)
   }
 
   /* Postorder traversal */
-  third_pass(node->child[0]);
-  third_pass(node->child[1]);
+  descent:
+    third_pass(node->child[0]);
+    third_pass(node->child[1]);
 
   /* Leaves with no assigned bucket are removed */
   if (node->bucket == NULL && is_leaf(node))