diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-12-16 22:48:13 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-12-16 22:48:13 +0100 |
commit | cfa6ff95695bcaff0c1046c63eb4a839c7a90cb7 (patch) | |
tree | e65ce66e0d5822f6442c242817c1b470a46e66d6 /nest | |
parent | cb311b441a6bbc02e88cd4a92e19044e2e95aac2 (diff) |
Nest: fix bug in previous patches related to channel reconfiguration
The patch d506263d... blocked adding channel during reconfiguration,
that broke protocols which use the same functiona also during init.
This patch fixes that.
Diffstat (limited to 'nest')
-rw-r--r-- | nest/proto.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nest/proto.c b/nest/proto.c index 7849b604..de727dac 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -663,9 +663,13 @@ proto_configure_channel(struct proto *p, struct channel **pc, struct channel_con { /* We could add the channel, but currently it would just stay in down state until protocol is restarted, so it is better to force restart anyways. */ - log(L_INFO "Cannot add channel %s.%s", p->name, cf->name); - return 0; - // *pc = proto_add_channel(p, cf); + if (p->proto_state != PS_DOWN) + { + log(L_INFO "Cannot add channel %s.%s", p->name, cf->name); + return 0; + } + + *pc = proto_add_channel(p, cf); } else if (c && !cf) { |