0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-03-21 22:07:03 +00:00

Modify aggregator_start() and shutdown()

This commit is contained in:
Igor Putovny 2024-06-13 16:37:10 +02:00
parent 4243f9db12
commit 9c43264985

View File

@ -1663,11 +1663,13 @@ aggregator_start(struct proto *P)
.data = p, .data = p,
}; };
p->trie_pool = lp_new(P->pool); if (PREFIX_AGGR == p->aggr_mode)
p->first_run = 1; {
p->aggr_done = 0; p->trie_pool = lp_new(P->pool);
settle_init(&p->notify_settle, &p->notify_settle_cf, request_feed_on_settle_timer, p);
}
settle_init(&p->notify_settle, &p->notify_settle_cf, aggregate_on_settle_timer, p); p->first_run = 1;
return PS_UP; return PS_UP;
} }
@ -1677,26 +1679,10 @@ aggregator_shutdown(struct proto *P)
{ {
struct aggregator_proto *p = SKIP_BACK(struct aggregator_proto, p, P); struct aggregator_proto *p = SKIP_BACK(struct aggregator_proto, p, P);
HASH_WALK_DELSAFE(p->buckets, next_hash, b)
{
while (b->rte)
{
struct aggregator_route *arte = SKIP_BACK(struct aggregator_route, rte, b->rte);
b->rte = arte->rte.next;
b->count--;
HASH_REMOVE(p->routes, AGGR_RTE, arte);
rta_free(arte->rte.attrs);
}
ASSERT_DIE(b->count == 0);
HASH_REMOVE(p->buckets, AGGR_BUCK, b);
}
HASH_WALK_END;
settle_cancel(&p->notify_settle); settle_cancel(&p->notify_settle);
assert(p->root != NULL); assert(p->root == NULL);
p->root = NULL; flush_aggregator(p);
return PS_DOWN; return PS_DOWN;
} }