summaryrefslogtreecommitdiff
path: root/isisd
diff options
context:
space:
mode:
Diffstat (limited to 'isisd')
-rw-r--r--isisd/isis_circuit.c41
-rw-r--r--isisd/isis_circuit.h3
-rw-r--r--isisd/isis_vty_fabricd.c8
-rw-r--r--isisd/isisd.h4
4 files changed, 54 insertions, 2 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index eed2c52552..6fef026898 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -1661,6 +1661,47 @@ static int isis_ifp_destroy(struct interface *ifp)
return 0;
}
+/* Reset IS hello timer after interval change */
+void isis_reset_hello_timer(struct isis_circuit *circuit)
+{
+ /* First send an immediate hello to prevent adjacency loss
+ * during longer hello interval transitions
+ */
+ if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
+ /* For broadcast circuits - need to handle both levels */
+ if (circuit->is_type & IS_LEVEL_1) {
+ /* send hello immediately */
+ send_hello(circuit, IS_LEVEL_1);
+
+ /* reset level-1 hello timer */
+ EVENT_OFF(circuit->u.bc.t_send_lan_hello[0]);
+ if (circuit->area && (circuit->area->is_type & IS_LEVEL_1))
+ send_hello_sched(circuit, IS_LEVEL_1,
+ isis_jitter(circuit->hello_interval[0],
+ IIH_JITTER));
+ }
+
+ if (circuit->is_type & IS_LEVEL_2) {
+ /* send hello immediately */
+ send_hello(circuit, IS_LEVEL_2);
+
+ /* reset level-2 hello timer */
+ EVENT_OFF(circuit->u.bc.t_send_lan_hello[1]);
+ if (circuit->area && (circuit->area->is_type & IS_LEVEL_2))
+ send_hello_sched(circuit, IS_LEVEL_2,
+ isis_jitter(circuit->hello_interval[1],
+ IIH_JITTER));
+ }
+ } else if (circuit->circ_type == CIRCUIT_T_P2P) {
+ /* For point-to-point circuits */
+ send_hello(circuit, IS_LEVEL_1);
+
+ /* reset hello timer */
+ EVENT_OFF(circuit->u.p2p.t_send_p2p_hello);
+ send_hello_sched(circuit, 0, isis_jitter(circuit->hello_interval[0], IIH_JITTER));
+ }
+}
+
void isis_circuit_init(void)
{
/* Initialize Zebra interface data structure */
diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h
index 7acde419fc..010ae2c8d2 100644
--- a/isisd/isis_circuit.h
+++ b/isisd/isis_circuit.h
@@ -232,6 +232,9 @@ ferr_r isis_circuit_passwd_hmac_md5_set(struct isis_circuit *circuit,
int isis_circuit_mt_enabled_set(struct isis_circuit *circuit, uint16_t mtid,
bool enabled);
+/* Reset ISIS hello timer and send immediate hello */
+void isis_reset_hello_timer(struct isis_circuit *circuit);
+
#ifdef FABRICD
DECLARE_HOOK(isis_circuit_config_write,
(struct isis_circuit *circuit, struct vty *vty),
diff --git a/isisd/isis_vty_fabricd.c b/isisd/isis_vty_fabricd.c
index 85ef2c40a1..75f6384da0 100644
--- a/isisd/isis_vty_fabricd.c
+++ b/isisd/isis_vty_fabricd.c
@@ -879,9 +879,17 @@ DEFUN (isis_hello_interval,
if (!circuit)
return CMD_ERR_NO_MATCH;
+ uint32_t old_interval_l1 = circuit->hello_interval[0];
+ uint32_t old_interval_l2 = circuit->hello_interval[1];
+
circuit->hello_interval[0] = interval;
circuit->hello_interval[1] = interval;
+ /* if interval changed, reset hello timer */
+ if (old_interval_l1 != interval || old_interval_l2 != interval) {
+ isis_reset_hello_timer(circuit);
+ }
+
return CMD_SUCCESS;
}
diff --git a/isisd/isisd.h b/isisd/isisd.h
index f9723c22e1..cd50d43a18 100644
--- a/isisd/isisd.h
+++ b/isisd/isisd.h
@@ -77,9 +77,9 @@ struct isis_master {
struct event_loop *master;
/* Various global options */
uint8_t options;
-#define ISIS_OPT_DUMMY_AS_LOOPBACK (1 << 0)
+#define F_ISIS_UNIT_TEST (1 << 0)
+#define ISIS_OPT_DUMMY_AS_LOOPBACK (1 << 1)
};
-#define F_ISIS_UNIT_TEST 0x01
#define ISIS_DEFAULT_MAX_AREA_ADDRESSES 3