]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Bugfix
authorIgor Putovny <igor.putovny@nic.cz>
Thu, 27 Feb 2025 15:43:43 +0000 (16:43 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Thu, 27 Feb 2025 15:51:26 +0000 (16:51 +0100)
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.

proto/aggregator/trie.c

index 9ef8cbde670dff3f923113bbef0c0ddaac33a7b5..c97e477b5d29dd02560d727c8c2e090c1e8bfdc6 100644 (file)
@@ -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;
 }