From: Daniel Walton <[email protected]>

Reduce the amount of time it takes to bring up a large number of peers

Signed-off-by: Daniel Walton <[email protected]>
---
 bgpd/bgp_fsm.c |   14 ++------------
 bgpd/bgpd.h    |    3 +--
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 2feb5ad..3808600 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -63,13 +63,6 @@ static int bgp_keepalive_timer (struct thread *);
 /* BGP FSM functions. */
 static int bgp_start (struct peer *);
 
-/* BGP start timer jitter. */
-static int
-bgp_start_jitter (int time)
-{
-  return ((random () % (time + 1)) - (time / 2));
-}
-
 static void
 peer_xfer_stats (struct peer *peer_dst, struct peer *peer_src)
 {
@@ -179,8 +172,6 @@ peer_xfer_conn(struct peer *from_peer)
 void
 bgp_timer_set (struct peer *peer)
 {
-  int jitter = 0;
-
   switch (peer->status)
     {
     case Idle:
@@ -193,9 +184,8 @@ bgp_timer_set (struct peer *peer)
        }
       else
        {
-         jitter = bgp_start_jitter (peer->v_start);
          BGP_TIMER_ON (peer->t_start, bgp_start_timer,
-                       peer->v_start + jitter);
+                       peer->v_start);
        }
       BGP_TIMER_OFF (peer->t_connect);
       BGP_TIMER_OFF (peer->t_holdtime);
@@ -205,7 +195,7 @@ bgp_timer_set (struct peer *peer)
       break;
 
     case Connect:
-      /* After start timer is expired, the peer moves to Connnect
+      /* After start timer is expired, the peer moves to Connect
          status.  Make sure start timer is off and connect timer is
          on. */
       BGP_TIMER_OFF (peer->t_start);
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index e147143..66e0e1f 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -788,14 +788,13 @@ struct bgp_nlri
 #define BGP_EVENTS_MAX                          15
 
 /* BGP timers default value.  */
-#define BGP_INIT_START_TIMER                     5
+#define BGP_INIT_START_TIMER                     1
 #define BGP_ERROR_START_TIMER                   30
 #define BGP_DEFAULT_HOLDTIME                   180
 #define BGP_DEFAULT_KEEPALIVE                   60 
 #define BGP_DEFAULT_ASORIGINATE                 15
 #define BGP_DEFAULT_EBGP_ROUTEADV               30
 #define BGP_DEFAULT_IBGP_ROUTEADV                5
-#define BGP_CLEAR_CONNECT_RETRY                 20
 #define BGP_DEFAULT_CONNECT_RETRY              120
 
 /* BGP default local preference.  */
-- 
1.7.10.4


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to