Randomize timers properly.
This commit is contained in:
parent
42532f0846
commit
b3155b3399
1 changed files with 5 additions and 2 deletions
|
@ -46,9 +46,12 @@ bgp_close(struct bgp_proto *p)
|
||||||
void
|
void
|
||||||
bgp_start_timer(timer *t, int value)
|
bgp_start_timer(timer *t, int value)
|
||||||
{
|
{
|
||||||
/* FIXME: Randomize properly */
|
|
||||||
if (value)
|
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
|
else
|
||||||
tm_stop(t);
|
tm_stop(t);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue