diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-11-22 14:38:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-22 14:38:05 +0100 |
commit | 039fb41165caa44265f82fd48d6402526d8a5184 (patch) | |
tree | 6f3c286dcaa7492c4d4b63b27723abddcde240bd /lib | |
parent | Merge pull request #10088 from opensourcerouting/pim-forward-stop (diff) | |
parent | lib: use _safe iteration during link_state/ted cleanup (diff) | |
download | frr-039fb41165caa44265f82fd48d6402526d8a5184.tar.xz frr-039fb41165caa44265f82fd48d6402526d8a5184.zip |
Merge pull request #10096 from mjstapp/fix_ted_free
lib: use _safe iteration during link_state/ted cleanup
Diffstat (limited to 'lib')
-rw-r--r-- | lib/link_state.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/link_state.c b/lib/link_state.c index 7d2e6f642..b0bc386b7 100644 --- a/lib/link_state.c +++ b/lib/link_state.c @@ -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); |