]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: avoid fast-reroute on down adjacency when the interface is down
authorLouis Scalbert <louis.scalbert@6wind.com>
Fri, 20 May 2022 13:29:21 +0000 (15:29 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Tue, 24 May 2022 08:05:49 +0000 (10:05 +0200)
When an IS-IS interface is coming down, fast-reroute may be triggered
twice: a first time after the detection of the interface down event and
a second time after the detection of the adjacency down (because of the
expiration of the ISIS Hello or BFD timers).

Avoid a BFD down event from running fast-reroute another time if the
interface was already detected down.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
isisd/isis_adjacency.c
isisd/isis_circuit.c
isisd/isis_circuit.h

index 5b32a9e388a0efcc5e72e07767878aa50533e74e..1b85299adf72d4c29c02a0a763e7b0a8051a6534 100644 (file)
@@ -328,7 +328,8 @@ void isis_adj_state_change(struct isis_adjacency **padj,
        if (new_state == old_state)
                return;
 
-       if (old_state == ISIS_ADJ_UP) {
+       if (old_state == ISIS_ADJ_UP &&
+           !CHECK_FLAG(adj->circuit->flags, ISIS_CIRCUIT_IF_DOWN_FROM_Z)) {
                if (IS_DEBUG_EVENTS)
                        zlog_debug(
                                "ISIS-Adj (%s): Starting fast-reroute on state change "
index 6072d6bf741353deb6d0b1b0a9fe345dbf8cd8bc..4717f1b0e37cf46219119c510d563096e6590b4a 100644 (file)
@@ -1631,8 +1631,10 @@ static int isis_ifp_up(struct interface *ifp)
 {
        struct isis_circuit *circuit = ifp->info;
 
-       if (circuit)
+       if (circuit) {
+               UNSET_FLAG(circuit->flags, ISIS_CIRCUIT_IF_DOWN_FROM_Z);
                isis_csm_state_change(IF_UP_FROM_Z, circuit, ifp);
+       }
 
        return 0;
 }
@@ -1643,6 +1645,7 @@ static int isis_ifp_down(struct interface *ifp)
        struct isis_circuit *circuit = ifp->info;
 
        if (circuit) {
+               SET_FLAG(circuit->flags, ISIS_CIRCUIT_IF_DOWN_FROM_Z);
                for (afi = AFI_IP; afi <= AFI_IP6; afi++)
                        isis_circuit_switchover_routes(
                                circuit, afi == AFI_IP ? AF_INET : AF_INET6,
index db8e2f752ac4fd513be57844461aa33cce329195..b3ad3f7ffe492229d2ec3e5c4bc25378c631fb25 100644 (file)
@@ -142,6 +142,7 @@ struct isis_circuit {
        struct list *ipv6_non_link; /* our non-link local IPv6 addresses */
        uint16_t upadjcount[ISIS_LEVELS];
 #define ISIS_CIRCUIT_FLAPPED_AFTER_SPF 0x01
+#define ISIS_CIRCUIT_IF_DOWN_FROM_Z 0x02
        uint8_t flags;
        bool disable_threeway_adj;
        struct {