Skip to content

Commit

Permalink
isisd: When operating multiple areas, the system ID behaves abnormally.
Browse files Browse the repository at this point in the history
When clearing the net in one of the areas, the system ID is unconditionally cleared, even if the net does not include the current system ID.

Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com>

isisd: When operating multiple areas, the system ID behaves abnormally.

When deleting one of the areas, even if the net under the area includes the current system ID, the system ID still remains.

Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com>
  • Loading branch information
zhou-run authored and baozhen-H3C committed May 27, 2024
1 parent ebdbb0e commit b1aaca2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions isisd/isis_nb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ int isis_instance_area_address_destroy(struct nb_cb_destroy_args *args)
return NB_ERR_INCONSISTENCY;

listnode_delete(area->area_addrs, addrp);
XFREE(MTYPE_ISIS_AREA_ADDR, addrp);
/*
* Last area address - reset the SystemID for this router
*/
if (listcount(area->area_addrs) == 0) {
if (!memcmp(addrp->area_addr + addrp->addr_len, area->isis->sysid, ISIS_SYS_ID_LEN)
&& 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])
Expand All @@ -268,6 +268,8 @@ int isis_instance_area_address_destroy(struct nb_cb_destroy_args *args)
zlog_debug("Router has no SystemID");
}

XFREE(MTYPE_ISIS_AREA_ADDR, addrp);

return NB_OK;
}

Expand Down
9 changes: 9 additions & 0 deletions isisd/isisd.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ void isis_area_destroy(struct isis_area *area)
{
struct listnode *node, *nnode;
struct isis_circuit *circuit;
struct area_addr *addr;

QOBJ_UNREG(area);

Expand Down Expand Up @@ -545,6 +546,14 @@ void isis_area_destroy(struct isis_area *area)
if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
isis_redist_area_finish(area);

if (listcount(area->area_addrs) > 0) {
addr = listgetdata(listhead(area->area_addrs));
if (!memcmp(addr->area_addr + addr->addr_len, area->isis->sysid, ISIS_SYS_ID_LEN)) {
memset(area->isis->sysid, 0, ISIS_SYS_ID_LEN);
area->isis->sysid_set = 0;
}
}

list_delete(&area->area_addrs);

for (int i = SPF_PREFIX_PRIO_CRITICAL; i <= SPF_PREFIX_PRIO_MEDIUM;
Expand Down

0 comments on commit b1aaca2

Please sign in to comment.