mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 15:41:54 +00:00
fixup! partial reload for RPKI - not working
This commit is contained in:
parent
90f70e0009
commit
292af59e06
@ -110,13 +110,28 @@ proto_postconfig(void)
|
|||||||
static inline void
|
static inline void
|
||||||
proto_call_cmd_reload(struct proto_spec ps, int dir, const struct f_trie *trie)
|
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);
|
struct proto_reload_request *prr = cfg_alloc(sizeof *prr);
|
||||||
*prr = (struct proto_reload_request) {
|
*prr = (struct proto_reload_request) {
|
||||||
.trie = trie,
|
.trie = trie,
|
||||||
.dir = dir,
|
.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);
|
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)
|
#define DIRECT_CFG ((struct rt_dev_config *) this_proto)
|
||||||
|
15
nest/proto.c
15
nest/proto.c
@ -361,6 +361,7 @@ channel_roa_in_reload_done(struct channel_import_request *req)
|
|||||||
static void
|
static void
|
||||||
channel_roa_in_changed(struct settle *se)
|
channel_roa_in_changed(struct settle *se)
|
||||||
{
|
{
|
||||||
|
log("channel_roa in changed");
|
||||||
struct roa_subscription *s = SKIP_BACK(struct roa_subscription, settle, se);
|
struct roa_subscription *s = SKIP_BACK(struct roa_subscription, settle, se);
|
||||||
struct channel *c = s->c;
|
struct channel *c = s->c;
|
||||||
|
|
||||||
@ -2807,6 +2808,9 @@ void
|
|||||||
proto_cmd_reload(struct proto *p, uintptr_t _prr, int cnt UNUSED)
|
proto_cmd_reload(struct proto *p, uintptr_t _prr, int cnt UNUSED)
|
||||||
{
|
{
|
||||||
struct proto_reload_request *prr = (void *) _prr;
|
struct proto_reload_request *prr = (void *) _prr;
|
||||||
|
|
||||||
|
if (prr->trie)
|
||||||
|
prr->ev.hook = channel_reload_out_done_main;
|
||||||
struct channel *c;
|
struct channel *c;
|
||||||
log("channel proto_cmd_reload_called");
|
log("channel proto_cmd_reload_called");
|
||||||
|
|
||||||
@ -2831,15 +2835,6 @@ proto_cmd_reload(struct proto *p, uintptr_t _prr, int cnt UNUSED)
|
|||||||
|
|
||||||
log(L_INFO "Reloading protocol %s", p->name);
|
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 */
|
/* re-importing routes */
|
||||||
if (prr->dir != CMD_RELOAD_OUT)
|
if (prr->dir != CMD_RELOAD_OUT)
|
||||||
WALK_LIST(c, p->channels)
|
WALK_LIST(c, p->channels)
|
||||||
@ -2893,8 +2888,6 @@ proto_cmd_reload(struct proto *p, uintptr_t _prr, int cnt UNUSED)
|
|||||||
channel_request_feeding_dynamic(c, CFRT_AUXILIARY);
|
channel_request_feeding_dynamic(c, CFRT_AUXILIARY);
|
||||||
|
|
||||||
cli_msg(-15, "%s: reloading", p->name);
|
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);
|
extern void pipe_update_debug(struct proto *P);
|
||||||
|
@ -766,8 +766,8 @@ krt_if_notify(struct proto *P, uint flags, struct iface *iface UNUSED)
|
|||||||
krt_scan_timer_kick(p);
|
krt_scan_timer_kick(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
krt_reload_routes(struct channel *C)
|
krt_reload_routes(struct channel *C, struct channel_import_request *UNUSED)
|
||||||
{
|
{
|
||||||
struct krt_proto *p = (void *) C->proto;
|
struct krt_proto *p = (void *) C->proto;
|
||||||
|
|
||||||
@ -778,6 +778,7 @@ krt_reload_routes(struct channel *C)
|
|||||||
p->reload = 1;
|
p->reload = 1;
|
||||||
krt_scan_timer_kick(p);
|
krt_scan_timer_kick(p);
|
||||||
}
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void krt_cleanup(struct krt_proto *p);
|
static void krt_cleanup(struct krt_proto *p);
|
||||||
|
Loading…
Reference in New Issue
Block a user