From 5991e935787d906fe5e55fbfe4834efa681026bd Mon Sep 17 00:00:00 2001 From: Emanuele Di Pascale Date: Mon, 2 Sep 2019 17:06:57 +0200 Subject: [PATCH] isisd: fix northbound circuit deletion circuit deletion was being enforced by sending a fake IF_DOWN_FROM_Z event for the circuit interface. This created a problem when the circuit was enabled again, since isisd internal state machine was expecting to see an IF_UP_FROM_Z that never came, as the interface had not actually gone down. As a consequence, disabling + re-enabling isis on an interface or area would leave interfaces in a CONFIG state, and adjacencies were not restored. Fix this by following the state machine and simply disabling circuits rather than attempting to delete them forcefully. Signed-off-by: Emanuele Di Pascale --- isisd/isis_northbound.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/isisd/isis_northbound.c b/isisd/isis_northbound.c index 0982a468a6..25c7058f3f 100644 --- a/isisd/isis_northbound.c +++ b/isisd/isis_northbound.c @@ -1561,21 +1561,8 @@ static int lib_interface_isis_destroy(enum nb_event event, circuit = nb_running_unset_entry(dnode); if (!circuit) return NB_ERR_INCONSISTENCY; - /* delete circuit through csm changes */ - switch (circuit->state) { - case C_STATE_UP: - isis_csm_state_change(IF_DOWN_FROM_Z, circuit, - circuit->interface); + if (circuit->state == C_STATE_UP || circuit->state == C_STATE_CONF) isis_csm_state_change(ISIS_DISABLE, circuit, circuit->area); - break; - case C_STATE_CONF: - isis_csm_state_change(ISIS_DISABLE, circuit, circuit->area); - break; - case C_STATE_INIT: - isis_csm_state_change(IF_DOWN_FROM_Z, circuit, - circuit->interface); - break; - } return NB_OK; }