From: Igor Putovny Date: Fri, 24 Jan 2025 14:13:43 +0000 (+0100) Subject: Add more checks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67f32882c431252072b61ba798dd3dba7328ae78;p=thirdparty%2Fbird.git Add more checks --- diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index a60de6c95..98fc3bdab 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -779,6 +779,19 @@ check_ancestors_after_aggregation(const struct trie_node *node) check_ancestors_after_aggregation(node->child[1]); } +static void +assert_trie(const struct trie_node *node) +{ + assert(node != NULL); + assert(node->original_bucket != NULL); + + if (node->child[0]) + assert_trie(node->child[0]); + + if (node->child[1]) + assert_trie(node->child[1]); +} + /* * Merge sets of potential buckets going from @node upwards. * Stop when sets don't change and return the last updated node.