From: Z-Yivon <202100460108@mail.sdu.edn.cn> Date: Wed, 5 Mar 2025 10:18:36 +0000 (+0800) Subject: isisd:IS-IS hello packets not sent with configured hello timer X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8088bc39ebfdd3051e22f0dbd4b17ec39a1f482d;p=mirror%2Ffrr.git isisd:IS-IS hello packets not sent with configured hello timer Signed-off-by: Z-Yivon <202100460108@mail.sdu.edn.cn> --- 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; }