mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 22:37:49 +00:00
isisd: Initialize/free SRv6 adjacency SIDs list
Initialize/free SRv6 adjacency SIDs list when an IS-IS area is created/destroyed. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
This commit is contained in:
parent
455aded931
commit
71b8056d6d
@ -702,6 +702,7 @@ void isis_srv6_area_init(struct isis_area *area)
|
||||
|
||||
/* Initialize SRv6 Data Base */
|
||||
memset(srv6db, 0, sizeof(*srv6db));
|
||||
srv6db->srv6_endx_sids = list_new();
|
||||
|
||||
/* Pull defaults from the YANG module */
|
||||
srv6db->config.enabled = yang_get_default_bool("%s/enabled", ISIS_SRV6);
|
||||
@ -727,11 +728,18 @@ void isis_srv6_area_init(struct isis_area *area)
|
||||
void isis_srv6_area_term(struct isis_area *area)
|
||||
{
|
||||
struct isis_srv6_db *srv6db = &area->srv6db;
|
||||
struct srv6_adjacency *sra;
|
||||
struct listnode *node, *nnode;
|
||||
struct srv6_locator_chunk *chunk;
|
||||
|
||||
sr_debug("ISIS-SRv6 (%s): Terminate SRv6", area->area_tag);
|
||||
|
||||
/* Uninstall all local SRv6 End.X SIDs */
|
||||
if (area->srv6db.config.enabled)
|
||||
for (ALL_LIST_ELEMENTS(area->srv6db.srv6_endx_sids, node, nnode,
|
||||
sra))
|
||||
srv6_endx_sid_del(sra);
|
||||
|
||||
/* Free SRv6 Locator chunks list */
|
||||
for (ALL_LIST_ELEMENTS(srv6db->srv6_locator_chunks, node, nnode, chunk))
|
||||
srv6_locator_chunk_free(&chunk);
|
||||
@ -739,6 +747,7 @@ void isis_srv6_area_term(struct isis_area *area)
|
||||
|
||||
/* Free SRv6 SIDs list */
|
||||
list_delete(&srv6db->srv6_sids);
|
||||
list_delete(&srv6db->srv6_endx_sids);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user