]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: configure preserve forwarding state from vty 49/head
authorJulien Courtat <julien.courtat@6wind.com>
Tue, 17 May 2016 14:26:22 +0000 (16:26 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 6 Jan 2017 14:08:48 +0000 (15:08 +0100)
Preserve forwarding state bit can be set in OPEN message with the use of
new vty commands
bgp graceful-restart preserve-fw-state
no bgp graceful-restart preserve-fw-state

This must be set before activating the connection to a peer, since it is
for forging graceful restart capability of OPEN messages.

Signed-off-by: Julien Courtat <julien.courtat@6wind.com>
bgpd/bgp_vty.c
bgpd/bgpd.c

index 1c2cc037f9d8670fae703275f19c52e73518b723..683c09bf6193e95215f27862b271ac5309b6710e 100644 (file)
@@ -1673,6 +1673,31 @@ DEFUN (no_bgp_graceful_restart_restart_time,
   return CMD_SUCCESS;
 }
 
+DEFUN (bgp_graceful_restart_preserve_fw,
+       bgp_graceful_restart_preserve_fw_cmd,
+       "bgp graceful-restart preserve-fw-state",
+       "BGP specific commands\n"
+       "Graceful restart capability parameters\n"
+       "Sets F-bit indication that fib is preserved while doing Graceful Restart\n")
+{
+  VTY_DECLVAR_CONTEXT(bgp, bgp);
+  bgp_flag_set(bgp, BGP_FLAG_GR_PRESERVE_FWD);
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_bgp_graceful_restart_preserve_fw,
+       no_bgp_graceful_restart_preserve_fw_cmd,
+       "no bgp graceful-restart preserve-fw-state",
+       NO_STR
+       "BGP specific commands\n"
+       "Graceful restart capability parameters\n"
+       "Unsets F-bit indication that fib is preserved while doing Graceful Restart\n")
+{
+  VTY_DECLVAR_CONTEXT(bgp, bgp);
+  bgp_flag_unset(bgp, BGP_FLAG_GR_PRESERVE_FWD);
+  return CMD_SUCCESS;
+}
+
 /* "bgp fast-external-failover" configuration. */
 DEFUN (bgp_fast_external_failover,
        bgp_fast_external_failover_cmd,
@@ -9852,6 +9877,9 @@ bgp_vty_init (void)
   install_element (BGP_NODE, &bgp_graceful_restart_restart_time_cmd);
   install_element (BGP_NODE, &no_bgp_graceful_restart_restart_time_cmd);
 
+  install_element (BGP_NODE, &bgp_graceful_restart_preserve_fw_cmd);
+  install_element (BGP_NODE, &no_bgp_graceful_restart_preserve_fw_cmd);
   /* "bgp fast-external-failover" commands */
   install_element (BGP_NODE, &bgp_fast_external_failover_cmd);
   install_element (BGP_NODE, &no_bgp_fast_external_failover_cmd);
index 68ad6bbe112a23c7d57733e67b74b22153f32de8..f9c3f9af4b72c7096e40ca34e226f8304f7871ba 100644 (file)
@@ -7371,6 +7371,10 @@ bgp_config_write (struct vty *vty)
       if (bgp_flag_check (bgp, BGP_FLAG_GRACEFUL_RESTART))
        vty_out (vty, " bgp graceful-restart%s", VTY_NEWLINE);
 
+      /* BGP graceful-restart Preserve State F bit. */
+      if (bgp_flag_check (bgp, BGP_FLAG_GR_PRESERVE_FWD))
+       vty_out (vty, " bgp graceful-restart preserve-fw-state%s", VTY_NEWLINE);
+
       /* BGP bestpath method. */
       if (bgp_flag_check (bgp, BGP_FLAG_ASPATH_IGNORE))
        vty_out (vty, " bgp bestpath as-path ignore%s", VTY_NEWLINE);