summaryrefslogtreecommitdiffstats
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-04-26 00:01:19 +0200
committerMartin Mares <mj@ucw.cz>2000-04-26 00:01:19 +0200
commitb3155b3399d84bb2dae8441171aa73236d790048 (patch)
tree1a69bc003bdbfae7d1d98ff6ed8045b8e6df2ae1 /proto/bgp/bgp.c
parent42532f084640645cfde9af7c0aa69a36b1de91ad (diff)
downloadbird-b3155b3399d84bb2dae8441171aa73236d790048.tar
bird-b3155b3399d84bb2dae8441171aa73236d790048.zip
Randomize timers properly.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index cdbdf46..11ad626 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -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);
}