mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-17 18:27:41 +00:00
Merge pull request #10947 from donaldsharp/isis_crash
isisd, lib, ospfd, pathd: Null out free'd pointer
This commit is contained in:
commit
896c1174fc
@ -1868,7 +1868,7 @@ int isis_instance_mpls_te_destroy(struct nb_cb_destroy_args *args)
|
|||||||
return NB_OK;
|
return NB_OK;
|
||||||
|
|
||||||
/* Remove Link State Database */
|
/* Remove Link State Database */
|
||||||
ls_ted_del_all(area->mta->ted);
|
ls_ted_del_all(&area->mta->ted);
|
||||||
|
|
||||||
/* Flush LSP if circuit engage */
|
/* Flush LSP if circuit engage */
|
||||||
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) {
|
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) {
|
||||||
|
@ -997,25 +997,26 @@ void ls_ted_del(struct ls_ted *ted)
|
|||||||
XFREE(MTYPE_LS_DB, ted);
|
XFREE(MTYPE_LS_DB, ted);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ls_ted_del_all(struct ls_ted *ted)
|
void ls_ted_del_all(struct ls_ted **ted)
|
||||||
{
|
{
|
||||||
struct ls_vertex *vertex;
|
struct ls_vertex *vertex;
|
||||||
struct ls_edge *edge;
|
struct ls_edge *edge;
|
||||||
struct ls_subnet *subnet;
|
struct ls_subnet *subnet;
|
||||||
|
|
||||||
if (ted == NULL)
|
if (*ted == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* First remove Vertices, Edges and Subnets and associated Link State */
|
/* First remove Vertices, Edges and Subnets and associated Link State */
|
||||||
frr_each_safe (vertices, &ted->vertices, vertex)
|
frr_each_safe (vertices, &(*ted)->vertices, vertex)
|
||||||
ls_vertex_del_all(ted, vertex);
|
ls_vertex_del_all(*ted, vertex);
|
||||||
frr_each_safe (edges, &ted->edges, edge)
|
frr_each_safe (edges, &(*ted)->edges, edge)
|
||||||
ls_edge_del_all(ted, edge);
|
ls_edge_del_all(*ted, edge);
|
||||||
frr_each_safe (subnets, &ted->subnets, subnet)
|
frr_each_safe (subnets, &(*ted)->subnets, subnet)
|
||||||
ls_subnet_del_all(ted, subnet);
|
ls_subnet_del_all(*ted, subnet);
|
||||||
|
|
||||||
/* then remove TED itself */
|
/* then remove TED itself */
|
||||||
ls_ted_del(ted);
|
ls_ted_del(*ted);
|
||||||
|
*ted = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ls_ted_clean(struct ls_ted *ted)
|
void ls_ted_clean(struct ls_ted *ted)
|
||||||
|
@ -746,7 +746,7 @@ extern void ls_ted_del(struct ls_ted *ted);
|
|||||||
*
|
*
|
||||||
* @param ted Link State Data Base
|
* @param ted Link State Data Base
|
||||||
*/
|
*/
|
||||||
extern void ls_ted_del_all(struct ls_ted *ted);
|
extern void ls_ted_del_all(struct ls_ted **ted);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean Link State Data Base by removing all Vertices, Edges and SubNets marked
|
* Clean Link State Data Base by removing all Vertices, Edges and SubNets marked
|
||||||
|
@ -3908,7 +3908,7 @@ DEFUN (no_ospf_mpls_te,
|
|||||||
ote_debug("MPLS-TE: ON -> OFF");
|
ote_debug("MPLS-TE: ON -> OFF");
|
||||||
|
|
||||||
/* Remove TED */
|
/* Remove TED */
|
||||||
ls_ted_del_all(OspfMplsTE.ted);
|
ls_ted_del_all(&OspfMplsTE.ted);
|
||||||
OspfMplsTE.enabled = false;
|
OspfMplsTE.enabled = false;
|
||||||
|
|
||||||
/* Flush all TE Opaque LSAs */
|
/* Flush all TE Opaque LSAs */
|
||||||
|
@ -66,7 +66,7 @@ uint32_t path_ted_teardown(void)
|
|||||||
PATH_TED_DEBUG("%s : TED [%p]", __func__, ted_state_g.ted);
|
PATH_TED_DEBUG("%s : TED [%p]", __func__, ted_state_g.ted);
|
||||||
path_ted_unregister_vty();
|
path_ted_unregister_vty();
|
||||||
path_ted_stop_importing_igp();
|
path_ted_stop_importing_igp();
|
||||||
ls_ted_del_all(ted_state_g.ted);
|
ls_ted_del_all(&ted_state_g.ted);
|
||||||
path_ted_timer_sync_cancel();
|
path_ted_timer_sync_cancel();
|
||||||
path_ted_timer_refresh_cancel();
|
path_ted_timer_refresh_cancel();
|
||||||
return 0;
|
return 0;
|
||||||
@ -391,7 +391,7 @@ DEFUN (no_path_ted,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Remove TED */
|
/* Remove TED */
|
||||||
ls_ted_del_all(ted_state_g.ted);
|
ls_ted_del_all(&ted_state_g.ted);
|
||||||
ted_state_g.enabled = false;
|
ted_state_g.enabled = false;
|
||||||
PATH_TED_DEBUG("%s: PATHD-TED: ON -> OFF", __func__);
|
PATH_TED_DEBUG("%s: PATHD-TED: ON -> OFF", __func__);
|
||||||
ted_state_g.import = IMPORT_UNKNOWN;
|
ted_state_g.import = IMPORT_UNKNOWN;
|
||||||
|
Loading…
Reference in New Issue
Block a user