* Insert prefix in @addr to prefix trie with root at @node
*/
static void
-trie_insert_prefix(const union net_addr_union *addr, struct aggregator_bucket *bucket, struct trie_node * const root, slab *trie_slab)
+trie_insert_prefix(const union net_addr_union *addr, struct trie_node * const root, struct aggregator_bucket *bucket, slab *trie_slab)
{
assert(addr != NULL);
assert(bucket != NULL);
* Check if @bucket is one of potential nexthop buckets in @node
*/
static int
-is_bucket_potential(const struct aggregator_bucket *bucket, const struct trie_node *node)
+is_bucket_potential(const struct trie_node *node, const struct aggregator_bucket *bucket)
{
for (int i = 0; i < node->potential_buckets_count; i++)
if (node->potential_buckets[i] == bucket)
* If bucket inherited from ancestor is among potential bucket for this node,
* this node doesn't need bucket because it inherits one
*/
- if (is_bucket_potential(inherited_bucket, node))
+ if (is_bucket_potential(node, inherited_bucket))
{
node->bucket = NULL;
remove_potential_buckets(node);
for (const struct rte *rte = bucket->rte; rte; rte = rte->next)
{
union net_addr_union *uptr = (net_addr_union *)rte->net->n.addr;
- trie_insert_prefix(uptr, bucket, p->root, p->trie_slab);
+ trie_insert_prefix(uptr, p->root, bucket, p->trie_slab);
}
}
HASH_WALK_END;