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)
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;
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");
}
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)
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);
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;
p->reload = 1;
krt_scan_timer_kick(p);
}
+ return 1;
}
static void krt_cleanup(struct krt_proto *p);