]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Bugfix
authorIgor Putovny <igor.putovny@nic.cz>
Fri, 28 Feb 2025 12:38:59 +0000 (13:38 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Fri, 28 Feb 2025 16:31:30 +0000 (17:31 +0100)
When removing prefix from the trie, we need to find the closest IN_FIB
ancestor of the updated node. However, since the updated node may still
have IN_FIB status, we need to check that the target node and updated node
are not the same.

This bug manifested itself in a following way. After running aggregator with
configuation A and reconfiguring it to configuration B, routes from A, which
should have been removed, were still present in the routing table. This was
caused by old prefixes not being removed from the trie.

Because of the missing condition that the updated node and its ancestor are not
the same, trie recalculation was called on prefix nodes which were, in most
cases, leaves. Therefore, trie was not updated at all. All prefixes were still
present in the trie, and thus in the routing table as well.

proto/aggregator/trie.c

index 0732a839696ce4c03a0c8b9cf57c3d64397d570e..b4ec2d5814179ddd77001a4eb5f5f35b0aa4d903 100644 (file)
@@ -976,7 +976,7 @@ aggregator_withdraw_prefix(struct aggregator_proto *p, struct aggregator_route *
    */
   while (1)
   {
-    if (node->status == IN_FIB)
+    if (node->status == IN_FIB && node != updated_node)
       break;
 
     node = node->parent;