Skip to content

Commit

Permalink
Merge pull request #11642 from FRRouting/mergify/bp/stable/8.3/pr-11635
Browse files Browse the repository at this point in the history
zebra: Cleanup the memory from the hash for MPLS stuff (backport #11635)
  • Loading branch information
Jafaral authored Jul 18, 2022
2 parents 7446853 + 0634473 commit d66a1ca
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions zebra/zebra_mpls.c
Original file line number Diff line number Diff line change
Expand Up @@ -4010,6 +4010,13 @@ void zebra_mpls_client_cleanup_vrf_label(uint8_t proto)
}
}

static void lsp_table_free(void *p)
{
struct zebra_lsp *lsp = p;

XFREE(MTYPE_LSP, lsp);
}

/*
* Called upon process exiting, need to delete LSP forwarding
* entries from the kernel.
Expand All @@ -4018,9 +4025,9 @@ void zebra_mpls_client_cleanup_vrf_label(uint8_t proto)
void zebra_mpls_close_tables(struct zebra_vrf *zvrf)
{
hash_iterate(zvrf->lsp_table, lsp_uninstall_from_kernel, NULL);
hash_clean(zvrf->lsp_table, NULL);
hash_clean(zvrf->lsp_table, lsp_table_free);
hash_free(zvrf->lsp_table);
hash_clean(zvrf->slsp_table, NULL);
hash_clean(zvrf->slsp_table, lsp_table_free);
hash_free(zvrf->slsp_table);
route_table_finish(zvrf->fec_table[AFI_IP]);
route_table_finish(zvrf->fec_table[AFI_IP6]);
Expand Down

0 comments on commit d66a1ca

Please sign in to comment.