diff options
Diffstat (limited to 'ospfd/ospf_main.c')
| -rw-r--r-- | ospfd/ospf_main.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 6be5486b55..d23dea0ca1 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -22,6 +22,7 @@ #include <zebra.h> #include <lib/version.h> +#include "bfd.h" #include "getopt.h" #include "thread.h" #include "prefix.h" @@ -98,6 +99,7 @@ static void sighup(void) static void sigint(void) { zlog_notice("Terminating on signal"); + bfd_protocol_integration_set_shutdown(true); ospf_terminate(); exit(0); } @@ -141,14 +143,12 @@ FRR_DAEMON_INFO(ospfd, OSPF, .vty_port = OSPF_VTY_PORT, .signals = ospf_signals, .n_signals = array_size(ospf_signals), .privs = &ospfd_privs, .yang_modules = ospfd_yang_modules, - .n_yang_modules = array_size(ospfd_yang_modules), ) + .n_yang_modules = array_size(ospfd_yang_modules), +); /* OSPFd main routine. */ int main(int argc, char **argv) { - unsigned short instance = 0; - bool created = false; - #ifdef SUPPORT_OSPF_API /* OSPF apiserver is disabled by default. */ ospf_apiserver_enable = 0; @@ -169,8 +169,8 @@ int main(int argc, char **argv) switch (opt) { case 'n': - ospfd_di.instance = instance = atoi(optarg); - if (instance < 1) + ospfd_di.instance = ospf_instance = atoi(optarg); + if (ospf_instance < 1) exit(0); break; case 0: @@ -208,7 +208,7 @@ int main(int argc, char **argv) /* OSPFd inits. */ ospf_if_init(); - ospf_zebra_init(master, instance); + ospf_zebra_init(master, ospf_instance); /* OSPF vty inits. */ ospf_vty_init(); @@ -216,7 +216,7 @@ int main(int argc, char **argv) ospf_vty_clear_init(); /* OSPF BFD init */ - ospf_bfd_init(); + ospf_bfd_init(master); /* OSPF LDP IGP Sync init */ ospf_ldp_sync_init(); @@ -227,17 +227,6 @@ int main(int argc, char **argv) /* OSPF errors init */ ospf_error_init(); - /* - * Need to initialize the default ospf structure, so the interface mode - * commands can be duly processed if they are received before 'router - * ospf', when ospfd is restarted - */ - if (instance && !ospf_get_instance(instance, &created)) { - flog_err(EC_OSPF_INIT_FAIL, "OSPF instance init failed: %s", - strerror(errno)); - exit(1); - } - frr_config_fork(); frr_run(master); |
