]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes BGP subcode during global shutdown.
authorOndrej Zajicek <santiago@crfreenet.org>
Mon, 6 Aug 2012 00:42:24 +0000 (02:42 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 6 Aug 2012 00:42:24 +0000 (02:42 +0200)
doc/bird.sgml
nest/proto.c
nest/protocol.h
proto/bgp/bgp.c

index 86ae5b0d0e197f3e136ddf7f79158784c15c5045..24bc302669866d8d817e844ffaf03c26638f772a 100644 (file)
@@ -477,7 +477,7 @@ to zero to disable it. An empty <cf><m/switch/</cf> is equivalent to <cf/on/
        problems in details of its behavior -- the number of exported
        routes can temporarily exceed the limit without triggering it
        during protocol reload, exported routes counter ignores route
-       blocking and block action also blocks route updates of alread
+       blocking and block action also blocks route updates of already
        accepted routes -- and these details will probably change in
        the future. Default: <cf/none/.
 
index 887d3e5e97962a8010f6d5eba2484911331283a6..53d3f1a2ed9f4af5f131be9fa32195a1453df9ef 100644 (file)
@@ -512,20 +512,22 @@ protos_commit(struct config *new, struct config *old, int force_reconfig, int ty
              else if (!p->disabled && nc->disabled)
                log(L_INFO "Disabling protocol %s", p->name);
 
-             PD(p, "Restarting");
              p->down_code = nc->disabled ? PDC_CF_DISABLE : PDC_CF_RESTART;
              p->cf_new = nc;
            }
-         else
+         else if (!shutting_down)
            {
-             if (!shutting_down)
-               log(L_INFO "Removing protocol %s", p->name);
-             PD(p, "Unconfigured");
+             log(L_INFO "Removing protocol %s", p->name);
              p->down_code = PDC_CF_REMOVE;
              p->cf_new = NULL;
            }
-         p->reconfiguring = 1;
+         else /* global shutdown */
+           {
+             p->down_code = PDC_CMD_SHUTDOWN;
+             p->cf_new = NULL;
+           }
 
+         p->reconfiguring = 1;
          config_add_obstacle(old);
          proto_rethink_goal(p);
        }
index 8a632715abcc2e5d8b536b131e0b592d54058b41..11fcb16423815d0af8a25569056f19696338ccc2 100644 (file)
@@ -222,8 +222,9 @@ struct proto_spec {
 #define PDC_CF_RESTART         0x03    /* Restart due to reconfiguration */
 #define PDC_CMD_DISABLE                0x11    /* Result of disable command */
 #define PDC_CMD_RESTART                0x12    /* Result of restart command */
+#define PDC_CMD_SHUTDOWN       0x13    /* Result of global shutdown */
 #define PDC_IN_LIMIT_HIT       0x21    /* Route import limit reached */
-#define PDC_OUT_LIMIT_HIT      0x22    /* Route export limit reached - not implemented */
+#define PDC_OUT_LIMIT_HIT      0x22    /* Route export limit reached */
 
 
 void *proto_new(struct proto_config *, unsigned size);
index 0b52dedc37ed621b089ad52e260b4f8f817a645a..dbc59eea2eb172c37845a3e87aa269978c70c780 100644 (file)
@@ -870,6 +870,7 @@ bgp_shutdown(struct proto *P)
       break;
 
     case PDC_CMD_DISABLE:
+    case PDC_CMD_SHUTDOWN:
       subcode = 2; // Errcode 6, 2 - administrative shutdown
       break;