]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Add more checks
authorIgor Putovny <igor.putovny@nic.cz>
Fri, 24 Jan 2025 14:13:43 +0000 (15:13 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Fri, 24 Jan 2025 14:13:43 +0000 (15:13 +0100)
proto/aggregator/aggregator.c

index a60de6c9524deb48db78e0f6afd8059b9ed9e85d..98fc3bdab0571cf07efc4cf99bb9b35c37c04c83 100644 (file)
@@ -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.