Mailing List Archive

i'd like to submit this jitter patch
Hi.

joespc /var/tmp/quagga-0.96.4/ripd 217$ diff -uwb ripd.c
~goliaa/ripd.c.new
--- ripd.c Sun Feb 22 18:42:22 2004
+++ /ms/user/g/goliaa/ripd.c.new Tue Feb 24 10:37:44 2004
@@ -2696,7 +2696,21 @@
int
rip_update_jitter (unsigned long time)
{
- return ((rand () % (time + 1)) - (time / 2));
+ /* We want to get the jitter to +/- 1/6 the interval.
+ Given that, we cannot let time be less than 6 seconds.
+ The RIPv2 RFC says jitter should be small compared to
+ update_time. We consider 1/6 to be small.
+ */
+
+ int jitter = 0;
+ int jitter_input = time;
+
+ if (jitter_input < 6)
+ jitter_input = 6;
+
+ jitter = (((rand () % ((jitter_input * 2) + 1)) - jitter_input));
+
+ return jitter/6;
}

void

the Changelog entry should be:

2004-02-24 Anthony Golia <goliaa@ms.com>

* ripd/ripd.c: (rip_update_jitter) make jitter more RFC compliant
by making jitter small compared to update_time



Cheers,
Anthony