From db36299b223c16f4fb9e24e58055dc99ca9d32e3 Mon Sep 17 00:00:00 2001 From: Igor Putovny Date: Fri, 7 Feb 2025 17:28:53 +0100 Subject: [PATCH] Use net_addr at rte_withdrawal struct, plus small changes --- proto/aggregator/aggregator.c | 10 +++++----- proto/aggregator/aggregator.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index 01475f103..dc4b11785 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -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; diff --git a/proto/aggregator/aggregator.h b/proto/aggregator/aggregator.h index 77d5e5b34..45dab2983 100644 --- a/proto/aggregator/aggregator.h +++ b/proto/aggregator/aggregator.h @@ -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 { -- 2.47.2