mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 12:37:10 +00:00
lib: use _safe iteration during link_state/ted cleanup
Use the _safe iterators when cleaning up the link-state module's vertices, edges, and subnets. Signed-off-by: Mark Stapp <mstapp@nvidia.com>
This commit is contained in:
parent
de093103cb
commit
bb0e68802d
@ -1010,11 +1010,11 @@ void ls_ted_del_all(struct ls_ted *ted)
|
||||
return;
|
||||
|
||||
/* First remove Vertices, Edges and Subnets and associated Link State */
|
||||
frr_each (vertices, &ted->vertices, vertex)
|
||||
frr_each_safe (vertices, &ted->vertices, vertex)
|
||||
ls_vertex_del_all(ted, vertex);
|
||||
frr_each (edges, &ted->edges, edge)
|
||||
frr_each_safe (edges, &ted->edges, edge)
|
||||
ls_edge_del_all(ted, edge);
|
||||
frr_each (subnets, &ted->subnets, subnet)
|
||||
frr_each_safe (subnets, &ted->subnets, subnet)
|
||||
ls_subnet_del_all(ted, subnet);
|
||||
|
||||
/* then remove TED itself */
|
||||
@ -1031,17 +1031,17 @@ void ls_ted_clean(struct ls_ted *ted)
|
||||
return;
|
||||
|
||||
/* First, start with Vertices */
|
||||
frr_each (vertices, &ted->vertices, vertex)
|
||||
frr_each_safe (vertices, &ted->vertices, vertex)
|
||||
if (vertex->status == ORPHAN)
|
||||
ls_vertex_del_all(ted, vertex);
|
||||
|
||||
/* Then Edges */
|
||||
frr_each (edges, &ted->edges, edge)
|
||||
frr_each_safe (edges, &ted->edges, edge)
|
||||
if (edge->status == ORPHAN)
|
||||
ls_edge_del_all(ted, edge);
|
||||
|
||||
/* and Subnets */
|
||||
frr_each (subnets, &ted->subnets, subnet)
|
||||
frr_each_safe (subnets, &ted->subnets, subnet)
|
||||
if (subnet->status == ORPHAN)
|
||||
ls_subnet_del_all(ted, subnet);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user