diff options
Diffstat (limited to 'ospfd/ospf_main.c')
| -rw-r--r-- | ospfd/ospf_main.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 1f476a7e3d..dd000241f4 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -27,6 +27,7 @@ #include "vrf.h" #include "libfrr.h" #include "routemap.h" +#include "keychain.h" #include "ospfd/ospfd.h" #include "ospfd/ospf_interface.h" @@ -134,6 +135,32 @@ FRR_DAEMON_INFO(ospfd, OSPF, .vty_port = OSPF_VTY_PORT, .n_yang_modules = array_size(ospfd_yang_modules), ); +/** Max wait time for config to load before accepting hellos */ +#define OSPF_PRE_CONFIG_MAX_WAIT_SECONDS 600 + +static void ospf_config_finish(struct event *t) +{ + zlog_err("OSPF configuration end timer expired after %d seconds.", + OSPF_PRE_CONFIG_MAX_WAIT_SECONDS); +} + +static void ospf_config_start(void) +{ + EVENT_OFF(t_ospf_cfg); + if (IS_DEBUG_OSPF_EVENT) + zlog_debug("ospfd config start callback received."); + event_add_timer(master, ospf_config_finish, NULL, + OSPF_PRE_CONFIG_MAX_WAIT_SECONDS, &t_ospf_cfg); +} + +static void ospf_config_end(void) +{ + if (IS_DEBUG_OSPF_EVENT) + zlog_debug("ospfd config end callback received."); + + EVENT_OFF(t_ospf_cfg); +} + /* OSPFd main routine. */ int main(int argc, char **argv) { @@ -192,6 +219,10 @@ int main(int argc, char **argv) access_list_init(); prefix_list_init(); + keychain_init(); + + /* Configuration processing callback initialization. */ + cmd_init_config_callbacks(ospf_config_start, ospf_config_end); /* OSPFd inits. */ ospf_if_init(); |
