diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-06-16 15:54:17 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-06-18 03:27:29 +0300 |
| commit | 3ae43012b2565fe820a99a4069c2ac0d7300fa26 (patch) | |
| tree | 308cb66e3879a4931db3f1d9b05d54d0a51dd798 | |
| parent | 6eadfc2d41547b74bab9c760ce7f61f40f1ad2c1 (diff) | |
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 <iryzhov@nfware.com>
| -rw-r--r-- | isisd/isis_circuit.c | 10 |
1 files 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); |
