Skip to content

Commit d66a1ca

Browse files
authored
Merge pull request #11642 from FRRouting/mergify/bp/stable/8.3/pr-11635
zebra: Cleanup the memory from the hash for MPLS stuff (backport #11635)
2 parents 7446853 + 0634473 commit d66a1ca

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

zebra/zebra_mpls.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4010,6 +4010,13 @@ void zebra_mpls_client_cleanup_vrf_label(uint8_t proto)
40104010
}
40114011
}
40124012

4013+
static void lsp_table_free(void *p)
4014+
{
4015+
struct zebra_lsp *lsp = p;
4016+
4017+
XFREE(MTYPE_LSP, lsp);
4018+
}
4019+
40134020
/*
40144021
* Called upon process exiting, need to delete LSP forwarding
40154022
* entries from the kernel.
@@ -4018,9 +4025,9 @@ void zebra_mpls_client_cleanup_vrf_label(uint8_t proto)
40184025
void zebra_mpls_close_tables(struct zebra_vrf *zvrf)
40194026
{
40204027
hash_iterate(zvrf->lsp_table, lsp_uninstall_from_kernel, NULL);
4021-
hash_clean(zvrf->lsp_table, NULL);
4028+
hash_clean(zvrf->lsp_table, lsp_table_free);
40224029
hash_free(zvrf->lsp_table);
4023-
hash_clean(zvrf->slsp_table, NULL);
4030+
hash_clean(zvrf->slsp_table, lsp_table_free);
40244031
hash_free(zvrf->slsp_table);
40254032
route_table_finish(zvrf->fec_table[AFI_IP]);
40264033
route_table_finish(zvrf->fec_table[AFI_IP6]);

0 commit comments

Comments
 (0)