1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Channel feeding request respects the subnet tries

This commit is contained in:
Maria Matejka
2023-10-04 10:39:46 +02:00
parent 898e268d0f
commit 2659aebd9b
2 changed files with 33 additions and 19 deletions

View File

@@ -357,6 +357,12 @@ channel_roa_in_changed(struct settle *se)
channel_request_reload(c);
}
static void
channel_roa_out_reload_done(struct channel_feeding_request *req)
{
rfree(req->trie->lp);
}
static void
channel_roa_out_changed(struct settle *se)
{
@@ -365,25 +371,15 @@ channel_roa_out_changed(struct settle *se)
CD(c, "Feeding triggered by RPKI change");
/* TODO feed by trie */
struct channel_feeding_request *cfr = lp_alloc(s->trie->lp, sizeof *cfr);
*cfr = (struct channel_feeding_request) {
.type = CFRT_AUXILIARY,
.trie = s->trie,
.done = channel_roa_out_reload_done,
};
channel_request_feeding(c, cfr);
/* Refeed already pending */
if ((s->cfr[0].state == CFRS_PENDING) || (s->cfr[1].state == CFRS_PENDING))
return;
/* First refeed inactive */
if (s->cfr[0].state == CFRS_INACTIVE)
{
s->cfr[0].type = CFRT_AUXILIARY;
channel_request_feeding(c, &s->cfr[0]);
}
else
{
/* Second refeed MUST be inactive */
ASSERT_DIE(s->cfr[1].state == CFRS_INACTIVE);
s->cfr[1].type = CFRT_AUXILIARY;
channel_request_feeding(c, &s->cfr[1]);
}
s->trie = f_new_trie(lp_new(c->proto->pool), 0);
}
static void