]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Fix crash in route reload when some channels are not up.
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 13 Aug 2019 17:00:25 +0000 (19:00 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 13 Aug 2019 17:00:25 +0000 (19:00 +0200)
Only channels that are up can be reloaded.

nest/proto.c

index 3d55f57b9fc580ceb3088d2c20ca6abae3972588..de7cf850f3f0362c9150b28f43c8de9969600187 100644 (file)
@@ -1888,7 +1888,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;
@@ -1899,12 +1899,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);
 }