]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Randomize timers properly.
authorMartin Mares <mj@ucw.cz>
Tue, 25 Apr 2000 22:01:19 +0000 (22:01 +0000)
committerMartin Mares <mj@ucw.cz>
Tue, 25 Apr 2000 22:01:19 +0000 (22:01 +0000)
proto/bgp/bgp.c

index cdbdf461285f334525239c4ab69d53e5079f54f4..11ad626462d379bd6cbe40173e2f8353d2198179 100644 (file)
@@ -46,9 +46,12 @@ bgp_close(struct bgp_proto *p)
 void
 bgp_start_timer(timer *t, int value)
 {
-  /* FIXME: Randomize properly */
   if (value)
-    tm_start(t, value);
+    {
+      /* The randomization procedure is specified in RFC 1771: 9.2.3.3 */
+      t->randomize = value / 4;
+      tm_start(t, value - t->randomize);
+    }
   else
     tm_stop(t);
 }