From: Igor Putovny Date: Fri, 24 Jan 2025 15:51:57 +0000 (+0100) Subject: Deaggregation runs on the whole subtree X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe8030e29349c90122abbc7e538088cbad09a054;p=thirdparty%2Fbird.git Deaggregation runs on the whole subtree --- diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index 57844c8f2..0caa98b5e 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -798,14 +798,9 @@ assert_trie(const struct trie_node *node) * computed by ORTC algorithm, and perform first pass on this subtree. */ static void -deaggregate_helper(struct trie_node * const node, const struct trie_node * const target) +deaggregate(struct trie_node * const node) { assert(node != NULL); - assert(target != NULL); - - /* Stop when subtree is already covered by another IN_FIB prefix */ - if (IN_FIB == node->status && node != target) - return; /* Delete information computed by aggregation */ node->selected_bucket = NULL; @@ -844,17 +839,10 @@ deaggregate_helper(struct trie_node * const node, const struct trie_node * const assert(node->ancestor == NULL); if (node->child[0]) - deaggregate_helper(node->child[0], target); + deaggregate(node->child[0]); if (node->child[1]) - deaggregate_helper(node->child[1], target); -} - -static void -deaggregate(struct trie_node *node) -{ - assert(node != NULL); - deaggregate_helper(node, node); + deaggregate(node->child[1]); } /*