0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

fixup! partial reload for RPKI - not working

This commit is contained in:
Katerina Kubecova 2023-10-24 12:00:03 +02:00
parent 90f70e0009
commit 292af59e06
3 changed files with 22 additions and 13 deletions

View File

@ -110,13 +110,28 @@ proto_postconfig(void)
static inline void
proto_call_cmd_reload(struct proto_spec ps, int dir, const struct f_trie *trie)
{
log("Start of cmd reload");
struct proto_reload_request *prr = cfg_alloc(sizeof *prr);
*prr = (struct proto_reload_request) {
.trie = trie,
.dir = dir,
.counter =1,
};
if (trie)
{
ASSERT_DIE(this_cli->parser_pool == prr->trie->lp);
rmove(this_cli->parser_pool, &root_pool);
this_cli->parser_pool = lp_new(this_cli->pool);
prr->ev = (event) {
.data = prr,
};
}
proto_apply_cmd(ps, proto_cmd_reload, 1, (uintptr_t) prr);
if (trie)
if (atomic_fetch_sub_explicit(&prr->counter, 1, memory_order_acq_rel) == 1)
ev_send_loop(&main_birdloop, &prr->ev);
}
#define DIRECT_CFG ((struct rt_dev_config *) this_proto)

View File

@ -361,6 +361,7 @@ channel_roa_in_reload_done(struct channel_import_request *req)
static void
channel_roa_in_changed(struct settle *se)
{
log("channel_roa in changed");
struct roa_subscription *s = SKIP_BACK(struct roa_subscription, settle, se);
struct channel *c = s->c;
@ -2807,6 +2808,9 @@ void
proto_cmd_reload(struct proto *p, uintptr_t _prr, int cnt UNUSED)
{
struct proto_reload_request *prr = (void *) _prr;
if (prr->trie)
prr->ev.hook = channel_reload_out_done_main;
struct channel *c;
log("channel proto_cmd_reload_called");
@ -2830,15 +2834,6 @@ proto_cmd_reload(struct proto *p, uintptr_t _prr, int cnt UNUSED)
}
log(L_INFO "Reloading protocol %s", p->name);
ASSERT_DIE(this_cli->parser_pool == prr->trie->lp);
rmove(this_cli->parser_pool, &root_pool);
this_cli->parser_pool = lp_new(this_cli->pool);
prr->ev = (event) {
.hook = channel_reload_out_done_main,
.data = prr,
};
prr->counter = 1;
/* re-importing routes */
if (prr->dir != CMD_RELOAD_OUT)
@ -2893,8 +2888,6 @@ proto_cmd_reload(struct proto *p, uintptr_t _prr, int cnt UNUSED)
channel_request_feeding_dynamic(c, CFRT_AUXILIARY);
cli_msg(-15, "%s: reloading", p->name);
if (atomic_fetch_sub_explicit(&prr->counter, 1, memory_order_acq_rel) == 1)
ev_send_loop(&main_birdloop, &prr->ev);
}
extern void pipe_update_debug(struct proto *P);

View File

@ -766,8 +766,8 @@ krt_if_notify(struct proto *P, uint flags, struct iface *iface UNUSED)
krt_scan_timer_kick(p);
}
static void
krt_reload_routes(struct channel *C)
static int
krt_reload_routes(struct channel *C, struct channel_import_request *UNUSED)
{
struct krt_proto *p = (void *) C->proto;
@ -778,6 +778,7 @@ krt_reload_routes(struct channel *C)
p->reload = 1;
krt_scan_timer_kick(p);
}
return 1;
}
static void krt_cleanup(struct krt_proto *p);