]> git.puffer.fish Git - matthieu/frr.git/commitdiff
[bgpd] Add 'bgp open-accept' option, to send OPEN immediately on accepted conns
authorPaul Jakma <paul.jakma@sun.com>
Fri, 31 Aug 2007 13:27:37 +0000 (14:27 +0100)
committerPaul Jakma <paul@quagga.net>
Fri, 22 Aug 2008 18:52:12 +0000 (19:52 +0100)
2007-08-31 Paul Jakma <paul.jakma@sun.com>

* (general) Add 'bgp open-accept' option, to allow bgpd to send OPEN
  on accepted connections, i.e. to not wait till after
  collision-detect to send OPEN, which appears to be allowed in
  RFC4271. This may help speed up establishing sessions, or help
  avoid FSM problems with sessions to certain peers. Not enabled by
  default though.

bgpd/ChangeLog
bgpd/bgp_fsm.c
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h

index 6fe2b0f5ae8984f5e248e2f03a8d59d80dc491f2..e92a72a95c9b4d4241a988858ea56f054041bc44 100644 (file)
        * bgp_debug.c: (community_str,community_com2str) Check com
          pointer before dereferencing.
 
+2007-08-31 Paul Jakma <paul.jakma@sun.com>
+
+       * (general) Add 'bgp open-accept' option, to allow bgpd to send OPEN
+         on accepted connections, i.e. to not wait till after
+         collision-detect to send OPEN, which appears to be allowed in
+         RFC4271. This may help speed up establishing sessions, or help
+         avoid FSM problems with sessions to certain peers. Not enabled by
+         default though.
+
 2007-08-27 Paul Jakma <paul.jakma@sun.com>
 
        * bgp_route.c: (bgp_announce_check) Fix bug #398, slight
index 15bd8a6c837d97bd33e40f87b9896b8721c23816..df1cfb7b50e6d5457cdc4014519353e272718555 100644 (file)
@@ -616,7 +616,8 @@ bgp_connect_success (struct peer *peer)
        zlog_debug ("%s passive open", peer->host);
     }
 
-  if (! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))
+  if (!CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER)
+      || bgp_option_check (BGP_OPT_ALWAYS_OPEN))
     bgp_open_send (peer);
 
   return 0;
index 54f11701befd6604d30a178741707aedb56dcc0f..908673730453cf6014a9e9ea8bc6772a58145df5 100644 (file)
@@ -279,6 +279,28 @@ DEFUN (no_bgp_config_type,
   return CMD_SUCCESS;
 }
 
+DEFUN_HIDDEN (bgp_open_accept,
+              bgp_open_accept_cmd,
+              "bgp open-accept",
+              BGP_STR
+              "Send OPEN immediately on accepted connections\n")
+{
+  bgp_option_set (BGP_OPT_ALWAYS_OPEN);
+  return CMD_SUCCESS;
+}
+
+DEFUN_HIDDEN (no_bgp_open_accept,
+              no_bgp_open_accept_cmd,
+              "no bgp open-accept",
+              NO_STR
+              BGP_STR
+              "Send OPEN immediately on accepted connections\n")
+
+{
+  bgp_option_unset (BGP_OPT_ALWAYS_OPEN);
+  return CMD_SUCCESS;
+}
+
 DEFUN (no_synchronization,
        no_synchronization_cmd,
        "no synchronization",
@@ -8820,6 +8842,10 @@ bgp_vty_init (void)
   install_element (CONFIG_NODE, &bgp_config_type_cmd);
   install_element (CONFIG_NODE, &no_bgp_config_type_cmd);
 
+  /* "bgp open-all" commands. */
+  install_element (CONFIG_NODE, &bgp_open_accept_cmd);
+  install_element (CONFIG_NODE, &no_bgp_open_accept_cmd);
+
   /* Dummy commands (Currently not supported) */
   install_element (BGP_NODE, &no_synchronization_cmd);
   install_element (BGP_NODE, &no_auto_summary_cmd);
index 8eb0d2e496521114cca4827950e8ec047a4c5f20..bda35ae592b4df1a7b15f33bf01983073d2bcc6a 100644 (file)
@@ -81,6 +81,7 @@ bgp_option_set (int flag)
     case BGP_OPT_NO_FIB:
     case BGP_OPT_MULTIPLE_INSTANCE:
     case BGP_OPT_CONFIG_CISCO:
+    case BGP_OPT_ALWAYS_OPEN:
       SET_FLAG (bm->options, flag);
       break;
     default:
@@ -100,6 +101,7 @@ bgp_option_unset (int flag)
       /* Fall through.  */
     case BGP_OPT_NO_FIB:
     case BGP_OPT_CONFIG_CISCO:
+    case BGP_OPT_ALWAYS_OPEN:
       UNSET_FLAG (bm->options, flag);
       break;
     default:
@@ -4910,6 +4912,13 @@ bgp_config_write (struct vty *vty)
       write++;
     }
 
+  /* BGP Open-Always */
+  if (bgp_option_check (BGP_OPT_ALWAYS_OPEN))
+    {    
+      vty_out (vty, "bgp open-accept%s", VTY_NEWLINE);
+      write++;
+    }
+
   /* BGP configuration. */
   for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
     {
index afe0663571d6e77993d2feeef930042a8c0014d6..89dde8f10151259adff62d13ed02449f1623e979 100644 (file)
@@ -59,6 +59,7 @@ struct bgp_master
 #define BGP_OPT_NO_FIB                   (1 << 0)
 #define BGP_OPT_MULTIPLE_INSTANCE        (1 << 1)
 #define BGP_OPT_CONFIG_CISCO             (1 << 2)
+#define BGP_OPT_ALWAYS_OPEN             (1 << 3)
 };
 
 /* BGP instance structure.  */