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    |  2 +-
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 0d38bfc..4fbd639 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)
 {
@@ -178,8 +171,6 @@ peer_xfer_conn(struct peer *from_peer)
 void
 bgp_timer_set (struct peer *peer)
 {
-  int jitter = 0;
-
   switch (peer->status)
     {
     case Idle:
@@ -192,9 +183,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);
@@ -203,7 +193,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 82b4efc..d58c7bf 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -786,7 +786,7 @@ 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_DEFAULT_HOLDTIME                     9
 #define BGP_DEFAULT_KEEPALIVE                    3
 #define BGP_DEFAULT_EBGP_ROUTEADV               30
-- 
1.9.1


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

Reply via email to