diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-08-13 18:57:40 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-08-14 06:02:33 +0200 |
commit | a297a4f044bcc7c38549710a720bc1f97df9ba65 (patch) | |
tree | 1d524ff63acf4655fc38fba6c11bee42dbbf0266 | |
parent | b7d7599ce3576f28310af18b403fed49a0840b67 (diff) |
Nest: Fix crash in route reload when some channels are not up.
Only channels that are up can be reloaded.
-rw-r--r-- | nest/proto.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nest/proto.c b/nest/proto.c index 54955bdd..6beca56d 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -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); } |