diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2022-07-18 17:58:02 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-18 17:58:02 -0500 | 
| commit | d66a1ca8da269a4de0084db45c5a9fc3352ae16c (patch) | |
| tree | 34e6c856b8e1f0c76e7f8ff2524a0bb0cc26ea96 | |
| parent | 7446853d7de28d37af2d9ed4342d6d9da170ec3c (diff) | |
| parent | 06344732900e91a4ae4001c3f28cba9c3acd348c (diff) | |
Merge pull request #11642 from FRRouting/mergify/bp/stable/8.3/pr-11635frr-8.3docker/8.3.0
zebra: Cleanup the memory from the hash for MPLS stuff (backport #11635)
| -rw-r--r-- | zebra/zebra_mpls.c | 11 | 
1 files changed, 9 insertions, 2 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 8237bebf3b..cca17f1a31 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -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. @@ -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]);  | 
