From: Igor Putovny Date: Mon, 9 Dec 2024 17:28:28 +0000 (+0100) Subject: Small changes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c10aff24381597bd506b90e262577cd06c455aec;p=thirdparty%2Fbird.git Small changes --- diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index bdcc3ff92..08c38dc45 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -118,7 +118,7 @@ create_new_node(linpool *trie_pool) } /* - * Mark appropriate child of parent node as NULL + * Unlink node from the trie by setting appropriate child of parent node to NULL */ static inline void remove_node(struct trie_node *node) @@ -181,6 +181,26 @@ get_new_bucket_id(struct aggregator_proto *p) return id; } +static inline struct aggregator_bucket * +choose_lowest_id_bucket(const struct aggregator_proto *p, const struct trie_node *node) +{ + assert(p != NULL); + assert(node != NULL); + + for (u32 i = 0; i < MAX_POTENTIAL_BUCKETS_COUNT; i++) + { + if (BIT32R_TEST(node->potential_buckets, i)) + { + struct aggregator_bucket *bucket = get_bucket_ptr(p, i); + assert(bucket != NULL); + assert(bucket->id == i); + return bucket; + } + } + + bug("No bucket to choose from"); +} + static inline int popcount32(u32 x) { @@ -389,26 +409,6 @@ before_check(const struct trie_node *node) before_check(node->child[1]); } -static struct aggregator_bucket * -choose_lowest_id_bucket(const struct aggregator_proto *p, const struct trie_node *node) -{ - assert(p != NULL); - assert(node != NULL); - - for (u32 i = 0; i < MAX_POTENTIAL_BUCKETS_COUNT; i++) - { - if (BIT32R_TEST(node->potential_buckets, i)) - { - struct aggregator_bucket *bucket = get_bucket_ptr(p, i); - assert(bucket != NULL); - assert(bucket->id == i); - return bucket; - } - } - - bug("No bucket to choose from"); -} - /* * First pass of Optimal Route Table Construction (ORTC) algorithm */ @@ -750,7 +750,7 @@ deaggregate(struct trie_node *node) /* * Merge sets of potential buckets from @node upwards. - * Stop when sets do not change and return the last updated node. + * Stop when sets don't change and return the last updated node. */ static struct trie_node * merge_buckets_above(struct trie_node *node)