mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 14:29:47 +00:00
pimd: Cleanup bfd memory on shutdown
When shutting down pim, ensure that we cleanup bfd memory Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
e2c4bc88d2
commit
662ba9e6f0
@ -99,9 +99,9 @@ void pim_bfd_info_nbr_create(struct pim_interface *pim_ifp,
|
||||
/*
|
||||
* pim_bfd_info_free - Free BFD info structure
|
||||
*/
|
||||
void pim_bfd_info_free(void **bfd_info)
|
||||
void pim_bfd_info_free(struct bfd_info **bfd_info)
|
||||
{
|
||||
bfd_info_free((struct bfd_info **)bfd_info);
|
||||
bfd_info_free(bfd_info);
|
||||
}
|
||||
|
||||
static void pim_bfd_reg_dereg_nbr(struct pim_neighbor *nbr, int command)
|
||||
@ -151,7 +151,7 @@ int pim_bfd_reg_dereg_all_nbr(struct interface *ifp, int command)
|
||||
if (command != ZEBRA_BFD_DEST_DEREGISTER)
|
||||
pim_bfd_info_nbr_create(pim_ifp, neigh);
|
||||
else
|
||||
bfd_info_free((struct bfd_info **)&neigh->bfd_info);
|
||||
pim_bfd_info_free((struct bfd_info **)&neigh->bfd_info);
|
||||
|
||||
pim_bfd_reg_dereg_nbr(neigh, command);
|
||||
}
|
||||
@ -170,7 +170,7 @@ void pim_bfd_trigger_event(struct pim_interface *pim_ifp,
|
||||
pim_bfd_info_nbr_create(pim_ifp, nbr);
|
||||
pim_bfd_reg_dereg_nbr(nbr, ZEBRA_BFD_DEST_REGISTER);
|
||||
} else {
|
||||
pim_bfd_info_free((void *)&nbr->bfd_info);
|
||||
pim_bfd_info_free(&nbr->bfd_info);
|
||||
pim_bfd_reg_dereg_nbr(nbr, ZEBRA_BFD_DEST_DEREGISTER);
|
||||
}
|
||||
}
|
||||
|
@ -36,5 +36,5 @@ void pim_bfd_trigger_event(struct pim_interface *pim_ifp,
|
||||
struct pim_neighbor *nbr, uint8_t nbr_up);
|
||||
void pim_bfd_info_nbr_create(struct pim_interface *pim_ifp,
|
||||
struct pim_neighbor *neigh);
|
||||
void pim_bfd_info_free(void **bfd_info);
|
||||
void pim_bfd_info_free(struct bfd_info **bfd_info);
|
||||
#endif /* _PIM_BFD_H */
|
||||
|
@ -409,6 +409,9 @@ void pim_neighbor_free(struct pim_neighbor *neigh)
|
||||
list_delete_and_null(&neigh->upstream_jp_agg);
|
||||
THREAD_OFF(neigh->jp_timer);
|
||||
|
||||
if (neigh->bfd_info)
|
||||
pim_bfd_info_free(&neigh->bfd_info);
|
||||
|
||||
XFREE(MTYPE_PIM_NEIGHBOR, neigh);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user