]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd:IS-IS hello packets not sent with configured hello timer
authorZ-Yivon <202100460108@mail.sdu.edn.cn>
Wed, 5 Mar 2025 10:18:36 +0000 (18:18 +0800)
committerZ-Yivon <202100460108@mail.sdu.edn.cn>
Wed, 5 Mar 2025 12:08:14 +0000 (20:08 +0800)
Signed-off-by: Z-Yivon <202100460108@mail.sdu.edn.cn>
isisd/isis_circuit.c
isisd/isis_circuit.h
isisd/isis_vty_fabricd.c

index eed2c52552199705ac94058842450dbec443634e..6fef026898ae8d2d8b4eed877dda48317af81311 100644 (file)
@@ -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 */
index 7acde419fcfae002ac954751446aa3d60df5a053..010ae2c8d20347e0ad4973762de96286078a190b 100644 (file)
@@ -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),
index 85ef2c40a10a40d1ce86d5899be39d18a1132130..75f6384da01841228164e6fa5e782a5ff4f0bbf1 100644 (file)
@@ -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;
 }