From b3155b3399d84bb2dae8441171aa73236d790048 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 25 Apr 2000 22:01:19 +0000 Subject: Randomize timers properly. --- proto/bgp/bgp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'proto/bgp') 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); } -- cgit v1.2.3