]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: fix bug in previous patches related to channel reconfiguration
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Sun, 16 Dec 2018 21:48:13 +0000 (22:48 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Sun, 16 Dec 2018 21:48:13 +0000 (22:48 +0100)
The patch d506263d... blocked adding channel during reconfiguration,
that broke protocols which use the same functiona also during init.
This patch fixes that.

nest/proto.c

index 7849b6042964a1d396806f2b09b69df192cf1008..de727dac08fd74f4333279e8332b3cee3eaa051a 100644 (file)
@@ -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)
   {