summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_main.c')
-rw-r--r--ospf6d/ospf6_main.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index 182faf0038..4ed6e2a604 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -55,7 +55,7 @@
#define OSPF6_VTY_PORT 2606
/* ospf6d privileges */
-zebra_capabilities_t _caps_p[] = {ZCAP_NET_RAW, ZCAP_BIND};
+zebra_capabilities_t _caps_p[] = {ZCAP_NET_RAW, ZCAP_BIND, ZCAP_SYS_ADMIN};
struct zebra_privs_t ospf6d_privs = {
#if defined(FRR_USER)
@@ -68,7 +68,7 @@ struct zebra_privs_t ospf6d_privs = {
.vty_group = VTY_GROUP,
#endif
.caps_p = _caps_p,
- .cap_num_p = 2,
+ .cap_num_p = array_size(_caps_p),
.cap_num_i = 0};
/* ospf6d options, we use GNU getopt library. */
@@ -81,27 +81,28 @@ static void __attribute__((noreturn)) ospf6_exit(int status)
{
struct vrf *vrf;
struct interface *ifp;
+ struct ospf6 *ospf6;
+ struct listnode *node, *nnode;
frr_early_fini();
- if (ospf6) {
+ for (ALL_LIST_ELEMENTS(om6->ospf6, node, nnode, ospf6)) {
vrf = vrf_lookup_by_id(ospf6->vrf_id);
+ ospf6_serv_close(&ospf6->fd);
+ FOR_ALL_INTERFACES (vrf, ifp)
+ if (ifp->info != NULL)
+ ospf6_interface_delete(ifp->info);
ospf6_delete(ospf6);
ospf6 = NULL;
- } else
- vrf = vrf_lookup_by_id(VRF_DEFAULT);
+ }
bfd_gbl_exit();
- FOR_ALL_INTERFACES (vrf, ifp)
- if (ifp->info != NULL)
- ospf6_interface_delete(ifp->info);
ospf6_message_terminate();
ospf6_asbr_terminate();
ospf6_lsa_terminate();
- ospf6_serv_close();
/* reverse access_list_init */
access_list_reset();
@@ -216,17 +217,17 @@ int main(int argc, char *argv[], char *envp[])
}
/* OSPF6 master init. */
- ospf6_master_init();
+ ospf6_master_init(frr_init());
/* thread master */
- master = frr_init();
+ master = om6->master;
vrf_init(NULL, NULL, NULL, NULL, NULL);
access_list_init();
prefix_list_init();
/* initialize ospf6 */
- ospf6_init();
+ ospf6_init(master);
frr_config_fork();
frr_run(master);