summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-06-18 16:27:21 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-06-30 21:29:24 +0200
commit8a68316eb96be1fecf91ca395f3321aa99997ad2 (patch)
treec38f9ef7d4733585c4658af5badbfa5f1a5e2ede /nest
parentbdf2e55d98636eacaac8188ee0bd000cc10d217c (diff)
Nest: Add command to request graceful restart
When 'graceful down' command is entered, protocols are shut down with regard to graceful restart. Namely Kernel protocol does not remove routes and BGP protocol does not send notification, just closes the connection.
Diffstat (limited to 'nest')
-rw-r--r--nest/proto.c5
-rw-r--r--nest/protocol.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 415471c4..beb3f393 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -1048,6 +1048,11 @@ protos_commit(struct config *new, struct config *old, int force_reconfig, int ty
p->down_code = PDC_CF_REMOVE;
p->cf_new = NULL;
}
+ else if (new->gr_down)
+ {
+ p->down_code = PDC_CMD_GR_DOWN;
+ p->cf_new = NULL;
+ }
else /* global shutdown */
{
p->down_code = PDC_CMD_SHUTDOWN;
diff --git a/nest/protocol.h b/nest/protocol.h
index b26d9cc1..53cccd5b 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -257,6 +257,7 @@ struct proto_spec {
#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_CMD_GR_DOWN 0x14 /* Result of global graceful restart */
#define PDC_RX_LIMIT_HIT 0x21 /* Route receive limit reached */
#define PDC_IN_LIMIT_HIT 0x22 /* Route import limit reached */
#define PDC_OUT_LIMIT_HIT 0x23 /* Route export limit reached */