diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-12-12 16:31:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-12 16:31:52 +0200 |
| commit | f17cd4587d025df33db6f57a6ac9bf33c65eba88 (patch) | |
| tree | 049e9a6e4c8b4514ef8c7d437b3ab3a79fa43cb7 /zebra/zebra_pw.c | |
| parent | 54625f5f94636fdaec4e6ae76cd8688dbb9c56ce (diff) | |
| parent | 3d1f0c467b3d8cd9c7cb0fd3ea81165748ee8af0 (diff) | |
Merge pull request #14985 from donaldsharp/zebra_delete_memory_problems
Zebra delete memory problems
Diffstat (limited to 'zebra/zebra_pw.c')
| -rw-r--r-- | zebra/zebra_pw.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c index f76bf747d6..deed3b6ad3 100644 --- a/zebra/zebra_pw.c +++ b/zebra/zebra_pw.c @@ -377,15 +377,18 @@ static int zebra_pw_client_close(struct zserv *client) return 0; } -void zebra_pw_init(struct zebra_vrf *zvrf) +static void zebra_pw_init(void) +{ + hook_register(zserv_client_close, zebra_pw_client_close); +} + +void zebra_pw_init_vrf(struct zebra_vrf *zvrf) { RB_INIT(zebra_pw_head, &zvrf->pseudowires); RB_INIT(zebra_static_pw_head, &zvrf->static_pseudowires); - - hook_register(zserv_client_close, zebra_pw_client_close); } -void zebra_pw_exit(struct zebra_vrf *zvrf) +void zebra_pw_exit_vrf(struct zebra_vrf *zvrf) { struct zebra_pw *pw; @@ -396,6 +399,11 @@ void zebra_pw_exit(struct zebra_vrf *zvrf) } } +void zebra_pw_terminate(void) +{ + hook_unregister(zserv_client_close, zebra_pw_client_close); +} + DEFUN_NOSH (pseudowire_if, pseudowire_if_cmd, "pseudowire IFNAME", @@ -837,4 +845,6 @@ void zebra_pw_vty_init(void) install_element(VIEW_NODE, &show_pseudowires_cmd); install_element(VIEW_NODE, &show_pseudowires_detail_cmd); + + zebra_pw_init(); } |
