]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Minor changes
authorIgor Putovny <igor.putovny@nic.cz>
Mon, 10 Mar 2025 13:57:24 +0000 (14:57 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Mon, 10 Mar 2025 13:57:24 +0000 (14:57 +0100)
proto/aggregator/aggregator.c
proto/aggregator/config.Y
proto/aggregator/trie.c

index 8ec2a992790d4cbc79301b7ec9c562ecc25a9d16..167e424256716405cf2ebdd691a31988290338f2 100644 (file)
@@ -811,7 +811,6 @@ aggregator_init_trie(struct aggregator_proto *p)
 
   /* Allocate bucket for root node */
   struct aggregator_bucket *new_bucket = lp_allocz(p->bucket_pool, sizeof(*new_bucket));
-  ASSERT_DIE(new_bucket->id == 0);
 
   u64 haux = 0;
   mem_hash_init(&haux);
index f73a6dfa267140d87923152ea46495d4e340ea69..8ac9a8a9d70d6cc9004858d3befa7ae3f6d66bc4 100644 (file)
@@ -57,8 +57,6 @@ aggregator_proto_item:
     int count = 0;
 
     for (const struct aggr_item_node *item = $3; item; item = item->next) {
-      log(L_WARN "type %d sacode %d", item->i.type, item->i.sa.sa_code);
-
       /*
        * If NET attribute is present, aggregate routes within the same net
        * and receive updates with any routes.
@@ -74,6 +72,7 @@ aggregator_proto_item:
    AGGREGATOR_CFG->aggr_on = cfg_alloc(sizeof(struct aggr_item) * count);
 
    int pos = 0;
+
    for (const struct aggr_item_node *item = $3; item; item = item->next) {
      if (item->i.type == AGGR_ITEM_DYNAMIC_ATTR)
        AGGREGATOR_CFG->aggr_on_da_count++;
index 863d7e8fc9fab2f762aeed54dedb1727a2c885aa..6684ea69dca106a28983e021f53998581cfd32c9 100644 (file)
@@ -387,7 +387,7 @@ aggregator_create_route(struct aggregator_proto *p, ip_addr prefix, u32 pxlen, s
   struct net_addr addr = { 0 };
   net_fill_ipa(&addr, prefix, pxlen);
 
-  struct network *n = allocz(sizeof(*n) + sizeof(struct net_addr));
+  struct network *n = allocz(sizeof(*n) + sizeof(addr));
   net_copy(n->n.addr, &addr);
 
   aggregator_bucket_update(p, bucket, n);
@@ -604,9 +604,7 @@ aggregator_second_pass(struct trie_node *node, int recomputing)
   ASSERT_DIE(node->original_bucket != NULL);
 
   /* Imaginary node if this was a complete binary tree */
-  struct trie_node imaginary_node = {
-    .parent = node,
-  };
+  struct trie_node imaginary_node = { 0 };
 
   /*
    * Imaginary node is used only for computing sets of potential buckets
@@ -980,6 +978,7 @@ aggregator_recompute(struct aggregator_proto *p, struct aggregator_route *old, s
 
   /* Find the closest IN_FIB ancestor of the updated node */
   // TODO: use node ancestor pointer instead of traversing
+  /*
   while (1)
   {
     if ((ancestor->status == IN_FIB && ancestor != updated_node) || !ancestor->parent)
@@ -987,8 +986,8 @@ aggregator_recompute(struct aggregator_proto *p, struct aggregator_route *old, s
 
     ancestor = ancestor->parent;
   }
+  */
 
-  /*
   while (ancestor = ancestor->parent)
   {
     ASSERT_DIE(ancestor != updated_node);
@@ -996,7 +995,6 @@ aggregator_recompute(struct aggregator_proto *p, struct aggregator_route *old, s
     if (ancestor->status == IN_FIB || !ancestor->parent)
       break;
   }
-  */
 
   // TODO: root should never get here
   ASSERT_DIE(ancestor != NULL);
@@ -1010,5 +1008,5 @@ aggregator_recompute(struct aggregator_proto *p, struct aggregator_route *old, s
   ASSERT_DIE(highest_node != NULL);
 
   aggregator_third_pass(p, highest_node);
-  check_trie_after_aggregation(p->root);
+  check_trie_after_aggregation(highest_node);
 }