]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Use net_addr at rte_withdrawal struct, plus small changes
authorIgor Putovny <igor.putovny@nic.cz>
Fri, 7 Feb 2025 16:28:53 +0000 (17:28 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Mon, 10 Feb 2025 14:14:41 +0000 (15:14 +0100)
proto/aggregator/aggregator.c
proto/aggregator/aggregator.h

index 01475f10387ef763efaaa38297faf3f12c5cf178..dc4b11785258fe06c76d7ac5dbd6798271c3cc37 100644 (file)
@@ -336,10 +336,11 @@ push_rte_withdraw_ip4(struct aggregator_proto *p, const struct net_addr_ip4 *add
 
   *node = (struct rte_withdrawal) {
     .next = p->rte_withdrawal_stack,
-    .addr = *addr,
     .bucket = bucket,
   };
 
+  net_copy(&node->addr, (net_addr *)addr);
+
   p->rte_withdrawal_stack = node;
   p->rte_withdrawal_count++;
 
@@ -362,7 +363,7 @@ aggregator_withdraw_rte(struct aggregator_proto *p)
   while (node)
   {
     assert(node != NULL);
-    rte_update2(p->dst, (net_addr *)&node->addr, NULL, node->bucket->last_src);
+    rte_update2(p->dst, &node->addr, NULL, node->bucket->last_src);
     node = node->next;
     p->rte_withdrawal_stack = node;
     p->rte_withdrawal_count--;
@@ -1043,7 +1044,7 @@ static void dump_trie(const struct trie_node *);
 static void print_prefixes(const struct trie_node *, int);
 
 static void
-trie_process_update(struct aggregator_proto *p, struct aggregator_route *old, struct aggregator_route *new)
+trie_process_update(struct aggregator_proto *p, struct aggregator_route *old UNUSED, struct aggregator_route *new)
 {
   assert(p != NULL);
   assert(new != NULL);
@@ -1069,9 +1070,8 @@ trie_process_update(struct aggregator_proto *p, struct aggregator_route *old, st
 
   assert(updated_node != NULL);
   assert(updated_node->original_bucket != NULL);
-  assert(updated_node->potential_buckets_count == 1);
-  assert(BIT32R_TEST(updated_node->potential_buckets, updated_node->original_bucket->id));
   assert(updated_node->status == NON_FIB);
+  assert(updated_node->px_origin == ORIGINAL);
 
   struct trie_node *node = updated_node;
 
index 77d5e5b34313c00055889dd8a75b1bc1f02dad94..45dab298340d3e6a65d561131e33e665218dd8d1 100644 (file)
@@ -58,7 +58,7 @@ struct aggregator_bucket {
 struct rte_withdrawal {
   struct rte_withdrawal *next;
   struct aggregator_bucket *bucket;
-  struct net_addr_ip4 addr;
+  struct net_addr addr;
 };
 
 struct aggregator_proto {