X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ospf6d%2Fospf6_main.c;h=046badc8248504b40847bd17787d236275fcf61a;hb=01b4cb3ed6181d7200f66e0187b1e5c5db6c0e5a;hp=28bb956c403d819328bbd03b27fd2931249c6495;hpb=a8a4fa8954fd3b4e5b4f9bc9173eef79a827a8ff;p=mirror_frr.git diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index 28bb956c4..046badc82 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -79,15 +79,17 @@ struct thread_master *master; static void __attribute__((noreturn)) ospf6_exit(int status) { - struct listnode *node; + struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT); struct interface *ifp; + frr_early_fini(); + if (ospf6) ospf6_delete(ospf6); bfd_gbl_exit(); - for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) + FOR_ALL_INTERFACES (vrf, ifp) if (ifp->info != NULL) ospf6_interface_delete(ifp->info); @@ -95,20 +97,22 @@ static void __attribute__((noreturn)) ospf6_exit(int status) ospf6_asbr_terminate(); ospf6_lsa_terminate(); + /* reverse access_list_init */ + access_list_reset(); + + /* reverse prefix_list_init */ + prefix_list_add_hook(NULL); + prefix_list_delete_hook(NULL); + prefix_list_reset(); + vrf_terminate(); - vty_terminate(); - cmd_terminate(); if (zclient) { zclient_stop(zclient); zclient_free(zclient); } - if (master) - thread_master_free(master); - - closezlog(); - + frr_fini(); exit(status); } @@ -129,7 +133,6 @@ static void sigint(void) static void sigterm(void) { zlog_notice("Terminating on signal SIGTERM"); - ospf6_clean(); ospf6_exit(0); } @@ -159,6 +162,10 @@ struct quagga_signal_t ospf6_signals[] = { }, }; +static const struct frr_yang_module_info *ospf6d_yang_modules[] = { + &frr_interface_info, +}; + FRR_DAEMON_INFO(ospf6d, OSPF6, .vty_port = OSPF6_VTY_PORT, .proghelp = "Implementation of the OSPFv3 routing protocol.", @@ -166,7 +173,8 @@ FRR_DAEMON_INFO(ospf6d, OSPF6, .vty_port = OSPF6_VTY_PORT, .signals = ospf6_signals, .n_signals = array_size(ospf6_signals), - .privs = &ospf6d_privs, ) + .privs = &ospf6d_privs, .yang_modules = ospf6d_yang_modules, + .n_yang_modules = array_size(ospf6d_yang_modules), ) /* Main routine of ospf6d. Treatment of argument and starting ospf finite state machine is handled here. */ @@ -199,10 +207,13 @@ int main(int argc, char *argv[], char *envp[]) exit(1); } + /* OSPF6 master init. */ + ospf6_master_init(); + /* thread master */ master = frr_init(); - vrf_init(NULL, NULL, NULL, NULL); + vrf_init(NULL, NULL, NULL, NULL, NULL); access_list_init(); prefix_list_init();