summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmanuele Di Pascale <emanuele@voltanet.io>2019-12-09 18:22:25 +0100
committerEmanuele Di Pascale <emanuele@voltanet.io>2019-12-09 18:22:25 +0100
commitd38a3cb24a40de1bb089e35a04f49b124ab9173e (patch)
treea590d7fea48e4fbe594adf5349e163c1b7d89202
parent0dcbec72aa2b508c194ec4391b6d821ea996fb08 (diff)
isisd: clean ipv4/6 circuit config on destroy
when deleting an isis interface config with 'no [ip|ipv6] router isis' we are destroying the isis yang container for that interface, but the actual circuit struct is kept, and so are the flgs determining whether that circuit is configured for ipv4 and/or ipv6. This caused issues when removing and re-adding configuration, as the area counters for ip circuits were not correctly updated and the topology was never populated. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
-rw-r--r--isisd/isis_nb_config.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c
index 820cfaa426..d14704b4ee 100644
--- a/isisd/isis_nb_config.c
+++ b/isisd/isis_nb_config.c
@@ -1550,9 +1550,13 @@ int lib_interface_isis_destroy(enum nb_event event,
circuit = nb_running_unset_entry(dnode);
if (!circuit)
return NB_ERR_INCONSISTENCY;
- if (circuit->state == C_STATE_UP || circuit->state == C_STATE_CONF)
- isis_csm_state_change(ISIS_DISABLE, circuit, circuit->area);
+ /* disable both AFs for this circuit. this will also update the
+ * CSM state by sending an ISIS_DISABLED signal. If there is no
+ * area associated to the circuit there is nothing to do
+ */
+ if (circuit->area)
+ isis_circuit_af_set(circuit, false, false);
return NB_OK;
}