From: Igor Putovny Date: Wed, 12 Feb 2025 17:08:15 +0000 (+0100) Subject: Rewrite prepare_rte_withdrawal() using ip_addr instead of net_addr X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=674c9c6c75315d44e84907bf548804e7a329a941;p=thirdparty%2Fbird.git Rewrite prepare_rte_withdrawal() using ip_addr instead of net_addr --- diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index 7d87fcdd0..771b0c652 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -328,15 +328,17 @@ proto_insert_bucket(struct aggregator_proto *p, struct aggregator_bucket *bucket } /* - * Each route which is to be withdrawed is pushed on the stack. + * Push routewhich is to be withdrawed on the stack */ static void -push_rte_withdraw_ip4(struct aggregator_proto *p, const struct net_addr_ip4 *addr, struct aggregator_bucket *bucket) +prepare_rte_withdrawal(struct aggregator_proto *p, ip_addr prefix, u32 pxlen, struct aggregator_bucket *bucket) { assert(p != NULL); - assert(addr != NULL); assert(bucket != NULL); + struct net_addr addr = { 0 }; + net_fill_ipa(&addr, prefix, pxlen); + struct rte_withdrawal *node = lp_allocz(p->rte_withdrawal_pool, sizeof(*node)); *node = (struct rte_withdrawal) { @@ -344,7 +346,7 @@ push_rte_withdraw_ip4(struct aggregator_proto *p, const struct net_addr_ip4 *add .bucket = bucket, }; - net_copy(&node->addr, (net_addr *)addr); + net_copy(&node->addr, addr); p->rte_withdrawal_stack = node; p->rte_withdrawal_count++;