summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFritz Reichmann <fritz@reichmann.nl>2009-08-06 18:17:33 +0000
committerDavid Lamparter <equinox@diac24.net>2010-02-03 05:09:28 +0100
commit06b5df9dd9e472faed400e765c77397333a78bbf (patch)
treeb0d1d88222ccbdbdae0d9d2325de8bd952de88f5
parent4a77e9f7769adea74f1711c324fcdd63e0d6eee5 (diff)
downloadquagga-06b5df9dd9e472faed400e765c77397333a78bbf.tar.bz2
quagga-06b5df9dd9e472faed400e765c77397333a78bbf.tar.xz
isisd: fixes 2/7: bug #539: wrong hello rate for pseudo node
* isis_pdu.c: Divide hello interval by three, depending if we are DIS or not.
-rw-r--r--isisd/isis_pdu.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c
index 26330a4d..4ea3ebd6 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -1943,6 +1943,9 @@ send_hello (struct isis_circuit *circuit, int level)
memset (&hello_hdr, 0, sizeof (struct isis_lan_hello_hdr));
interval = circuit->hello_multiplier[level - 1] *
circuit->hello_interval[level - 1];
+ /* If we are the DIS then hello interval is divided by three, as is the hold-timer */
+ if (circuit->u.bc.is_dr[level - 1])
+ interval=interval/3;
if (interval > USHRT_MAX)
interval = USHRT_MAX;
hello_hdr.circuit_t = circuit->circuit_is_type;
@@ -2065,9 +2068,21 @@ send_lan_l1_hello (struct thread *thread)
{
struct isis_circuit *circuit;
int retval;
+ unsigned long next_hello;
circuit = THREAD_ARG (thread);
assert (circuit);
+
+ if (!circuit->area) {
+ return ISIS_OK;
+ }
+
+ /* Pseudonode sends hellos three times more than the other nodes */
+ if (circuit->u.bc.is_dr[0])
+ next_hello=circuit->hello_interval[0]/3+1;
+ else
+ next_hello=circuit->hello_interval[0];
+
circuit->u.bc.t_send_lan_hello[0] = NULL;
if (circuit->u.bc.run_dr_elect[0])
@@ -2078,7 +2093,7 @@ send_lan_l1_hello (struct thread *thread)
/* set next timer thread */
THREAD_TIMER_ON (master, circuit->u.bc.t_send_lan_hello[0],
send_lan_l1_hello, circuit,
- isis_jitter (circuit->hello_interval[0], IIH_JITTER));
+ isis_jitter (next_hello, IIH_JITTER));
return retval;
}
@@ -2088,6 +2103,7 @@ send_lan_l2_hello (struct thread *thread)
{
struct isis_circuit *circuit;
int retval;
+ unsigned long next_hello;
circuit = THREAD_ARG (thread);
assert (circuit);
@@ -2096,6 +2112,12 @@ send_lan_l2_hello (struct thread *thread)
return ISIS_OK;
}
+ /* Pseudonode sends hellos three times more than the other nodes */
+ if (circuit->u.bc.is_dr[1])
+ next_hello=circuit->hello_interval[1]/3+1;
+ else
+ next_hello=circuit->hello_interval[1];
+
circuit->u.bc.t_send_lan_hello[1] = NULL;
if (circuit->u.bc.run_dr_elect[1])
@@ -2106,7 +2128,7 @@ send_lan_l2_hello (struct thread *thread)
/* set next timer thread */
THREAD_TIMER_ON (master, circuit->u.bc.t_send_lan_hello[1],
send_lan_l2_hello, circuit,
- isis_jitter (circuit->hello_interval[1], IIH_JITTER));
+ isis_jitter (next_hello, IIH_JITTER));
return retval;
}