]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: When last area address is removed, resign if we were DR
authorKaren Schoener <karen@voltanet.io>
Tue, 5 Jan 2021 21:27:32 +0000 (16:27 -0500)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 20 Jan 2021 15:53:47 +0000 (18:53 +0300)
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 <karen@voltanet.io>
isisd/isis_nb_config.c

index f83d2343bd3ac8e2c36a2406c4fb1efef9f8284e..690f2838c1a42c49a406aa7b88481a76c4b35584 100644 (file)
@@ -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)