Commit a297a4f0 authored by Ondřej Zajíček's avatar Ondřej Zajíček

Nest: Fix crash in route reload when some channels are not up.

Only channels that are up can be reloaded.
parent b7d7599c
Pipeline #51257 passed with stages
in 7 minutes and 37 seconds
......@@ -1952,7 +1952,7 @@ proto_cmd_reload(struct proto *p, uintptr_t dir, int cnt UNUSED)
/* All channels must support reload */
if (dir != CMD_RELOAD_OUT)
WALK_LIST(c, p->channels)
if (!channel_reloadable(c))
if ((c->channel_state == CS_UP) && !channel_reloadable(c))
{
cli_msg(-8006, "%s: reload failed", p->name);
return;
......@@ -1963,12 +1963,14 @@ proto_cmd_reload(struct proto *p, uintptr_t dir, int cnt UNUSED)
/* re-importing routes */
if (dir != CMD_RELOAD_OUT)
WALK_LIST(c, p->channels)
channel_request_reload(c);
if (c->channel_state == CS_UP)
channel_request_reload(c);
/* re-exporting routes */
if (dir != CMD_RELOAD_IN)
WALK_LIST(c, p->channels)
channel_request_feeding(c);
if (c->channel_state == CS_UP)
channel_request_feeding(c);
cli_msg(-15, "%s: reloading", p->name);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment