From: Igor Putovny Date: Thu, 27 Feb 2025 15:43:43 +0000 (+0100) Subject: Bugfix X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8830623dc790a9d1302e8a89448d33d21c6a3821;p=thirdparty%2Fbird.git Bugfix Fix aggregator_trie_remove_prefix() Never change FIB status except in the third pass. FIB status is decided only by the algorithm and no one else. Never withdraw route except in the third pass. Again, route exports and withdrawals are solely the algorithm's responsibility. Keep selected bucket because it will be needed for route withdrawal in the third pass. --- diff --git a/proto/aggregator/trie.c b/proto/aggregator/trie.c index 9ef8cbde6..c97e477b5 100644 --- a/proto/aggregator/trie.c +++ b/proto/aggregator/trie.c @@ -479,37 +479,14 @@ aggregator_trie_remove_prefix(struct aggregator_proto *p, ip_addr prefix, u32 px } ASSERT_DIE(node->px_origin == ORIGINAL); - ASSERT_DIE(node->selected_bucket != NULL); ASSERT_DIE((u32)node->depth == pxlen); - /* If this prefix was IN_FIB, remove its route */ - if (node->status == IN_FIB) - aggregator_prepare_rte_withdrawal(p, prefix, pxlen, node->selected_bucket); - - node->status = NON_FIB; node->px_origin = FILLER; node->ancestor = NULL; node->original_bucket = NULL; - node->selected_bucket = NULL; node->potential_buckets_count = 0; memset(node->potential_buckets, 0, sizeof(node->potential_buckets)); - /* - * If prefix node is a leaf, remove it with the branch it resides on, - * until non-leaf or prefix node is reached. - */ - for (struct trie_node *parent = node->parent; parent; node = parent, parent = node->parent) - { - if (node->px_origin == FILLER && aggregator_is_leaf(node)) - { - aggregator_remove_node(node); - ASSERT_DIE(node != NULL); - ASSERT_DIE(parent != NULL); - } - else - break; - } - return node; }