From: Katerina Kubecova Date: Tue, 24 Oct 2023 10:00:03 +0000 (+0200) Subject: fixup! partial reload for RPKI - not working X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=292af59e0688c57f4f8c4ae664d0476b7d6b5405;p=thirdparty%2Fbird.git fixup! partial reload for RPKI - not working --- diff --git a/nest/config.Y b/nest/config.Y index e0329d400..bb1b6f335 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -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) diff --git a/nest/proto.c b/nest/proto.c index 728c0e549..f61a49e8f 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -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); diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index bb638a70b..a216dbc3e 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -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);