From 0f2f32fa1ce42ab8aefe2b7c3dbb818bb898705d Mon Sep 17 00:00:00 2001 From: Karen Schoener Date: Tue, 5 Jan 2021 16:27:32 -0500 Subject: [PATCH] isisd: When last area address is removed, resign if we were DR When last area address is removed, resign if we were DR. This fixes an issue where: when the ISIS area address is changed, ISIS fails to elect a new DR. Signed-off-by: Karen Schoener --- isisd/isis_nb_config.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index f83d2343bd..690f2838c1 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -45,6 +45,7 @@ #include "isisd/isis_memory.h" #include "isisd/isis_mt.h" #include "isisd/isis_redist.h" +#include "isisd/isis_dr.h" /* * XPath: /frr-isisd:isis/instance @@ -199,6 +200,9 @@ int isis_instance_area_address_destroy(struct nb_cb_destroy_args *args) uint8_t buff[255]; struct isis_area *area; const char *net_title; + struct listnode *cnode; + struct isis_circuit *circuit; + int lvl; if (args->event != NB_EV_APPLY) return NB_OK; @@ -222,6 +226,11 @@ int isis_instance_area_address_destroy(struct nb_cb_destroy_args *args) * Last area address - reset the SystemID for this router */ if (listcount(area->area_addrs) == 0) { + for (ALL_LIST_ELEMENTS_RO(area->circuit_list, cnode, circuit)) + for (lvl = IS_LEVEL_1; lvl <= IS_LEVEL_2; ++lvl) { + if (circuit->u.bc.is_dr[lvl - 1]) + isis_dr_resign(circuit, lvl); + } memset(area->isis->sysid, 0, ISIS_SYS_ID_LEN); area->isis->sysid_set = 0; if (IS_DEBUG_EVENTS) -- 2.39.5