mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 17:51:53 +00:00
Move trie initialization to aggregator_start()
This commit is contained in:
parent
b48ac47aec
commit
812e646625
@ -109,13 +109,7 @@ remove_node(struct trie_node *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
trie_init(struct aggregator_proto *p)
|
|
||||||
{
|
{
|
||||||
static int inits = 0;
|
|
||||||
p->trie_slab = sl_new(p->p.pool, sizeof(struct trie_node));
|
|
||||||
p->root = new_node(p->trie_slab);
|
|
||||||
inits++;
|
|
||||||
log("Trie inits: %d", inits);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1161,8 +1155,6 @@ aggregator_rt_notify(struct proto *P, struct channel *src_ch, net *net, rte *new
|
|||||||
sl_free(old_route);
|
sl_free(old_route);
|
||||||
}
|
}
|
||||||
|
|
||||||
trie_init(p);
|
|
||||||
|
|
||||||
HASH_WALK(p->buckets, next_hash, bucket)
|
HASH_WALK(p->buckets, next_hash, bucket)
|
||||||
{
|
{
|
||||||
for (const struct rte *rte = bucket->rte; rte; rte = rte->next)
|
for (const struct rte *rte = bucket->rte; rte; rte = rte->next)
|
||||||
@ -1307,6 +1299,9 @@ aggregator_start(struct proto *P)
|
|||||||
.data = p,
|
.data = p,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
p->trie_slab = sl_new(p->p.pool, sizeof(struct trie_node));
|
||||||
|
p->root = new_node(p->trie_slab);
|
||||||
|
|
||||||
return PS_UP;
|
return PS_UP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user