Skip to content

Commit

Permalink
zebra: Cleanup linked list on shutdown in label manager
Browse files Browse the repository at this point in the history
Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Dec 11, 2023
1 parent 7cabd93 commit f770954
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions zebra/label_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ void label_manager_init(void)
install_element(CONFIG_NODE, &mpls_label_dynamic_block_cmd);
}

void label_manager_terminate(void)
{
list_delete(&lbl_mgr.lc_list);
}

/* alloc and fill a label chunk */
struct label_manager_chunk *
create_label_chunk(uint8_t proto, unsigned short instance, uint32_t session_id,
Expand Down
2 changes: 2 additions & 0 deletions zebra/label_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ struct label_manager {
};

void label_manager_init(void);
void label_manager_terminate(void);

struct label_manager_chunk *
assign_label_chunk(uint8_t proto, unsigned short instance, uint32_t session_id,
uint8_t keep, uint32_t size, uint32_t base);
Expand Down
2 changes: 2 additions & 0 deletions zebra/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ void zebra_finalize(struct event *dummy)

zebra_pw_terminate();

label_manager_terminate();

ns_terminate();
frr_fini();
exit(0);
Expand Down

0 comments on commit f770954

Please sign in to comment.