From facfb69d8b950f63ecda73f63ff017ef2cb2fbf8 Mon Sep 17 00:00:00 2001 From: Igor Putovny Date: Fri, 28 Feb 2025 13:38:59 +0100 Subject: [PATCH] Bugfix 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/aggregator/trie.c b/proto/aggregator/trie.c index 0732a8396..b4ec2d581 100644 --- a/proto/aggregator/trie.c +++ b/proto/aggregator/trie.c @@ -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; -- 2.47.2