From 6eadfc2d41547b74bab9c760ce7f61f40f1ad2c1 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 16 Jun 2021 15:52:14 +0300 Subject: [PATCH 1/2] isisd: fix adding a circuit to the wrong area When creating a new area, we're adding all circuits in the same VRF to this area. We should only add circuits configured with the same tag. Signed-off-by: Igor Ryzhov --- isisd/isisd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isisd/isisd.c b/isisd/isisd.c index 77b18f9cf7..05d8741991 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -402,7 +402,7 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name) continue; circuit = ifp->info; - if (circuit) + if (circuit && strmatch(circuit->tag, area->area_tag)) isis_area_add_circuit(area, circuit); } } From 3ae43012b2565fe820a99a4069c2ac0d7300fa26 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 16 Jun 2021 15:54:17 +0300 Subject: [PATCH 2/2] isis: fix double-adding a circuit to the area isis_circuit_enable can be called for an already enabled circuit. In this case we would add the circuit to the area multiple times. Signed-off-by: Igor Ryzhov --- isisd/isis_circuit.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 4fa28a4ad9..896bbc2cb0 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -78,12 +78,14 @@ DEFINE_HOOK(isis_circuit_del_hook, (struct isis_circuit *circuit), (circuit)); static void isis_circuit_enable(struct isis_circuit *circuit) { - struct isis_area *area; + struct isis_area *area = circuit->area; struct interface *ifp = circuit->interface; - area = isis_area_lookup(circuit->tag, ifp->vrf_id); - if (area) - isis_area_add_circuit(area, circuit); + if (!area) { + area = isis_area_lookup(circuit->tag, ifp->vrf_id); + if (area) + isis_area_add_circuit(area, circuit); + } if (if_is_operative(ifp)) isis_csm_state_change(IF_UP_FROM_Z, circuit, ifp);