summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_main.c
diff options
context:
space:
mode:
authorAcee <aceelindem@gmail.com>2023-06-18 07:22:45 -0400
committerAcee <aceelindem@gmail.com>2023-06-23 07:48:02 -0400
commit4e410167c094bf8c88e52f079322843fa3717d16 (patch)
tree63113f069fc77e4caf8359b941356dcc39abe52c /ospf6d/ospf6_main.c
parent0fb16305200113a92e3862e05d6833217f935211 (diff)
ospf6d: Add config callbacks to suppress hellos during config load. Add bgpd/isisd message.
Signed-off-by: Acee <aceelindem@gmail.com>
Diffstat (limited to 'ospf6d/ospf6_main.c')
-rw-r--r--ospf6d/ospf6_main.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index fdb93475d4..932304578a 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -173,6 +173,32 @@ FRR_DAEMON_INFO(ospf6d, OSPF6, .vty_port = OSPF6_VTY_PORT,
.n_yang_modules = array_size(ospf6d_yang_modules),
);
+/* Max wait time for config to load before accepting hellos */
+#define OSPF6_PRE_CONFIG_MAX_WAIT_SECONDS 600
+
+static void ospf6_config_finish(struct event *t)
+{
+ zlog_err("OSPF6 configuration end timer expired after %d seconds.",
+ OSPF6_PRE_CONFIG_MAX_WAIT_SECONDS);
+}
+
+static void ospf6_config_start(void)
+{
+ if (IS_OSPF6_DEBUG_EVENT)
+ zlog_debug("ospf6d config start received");
+ EVENT_OFF(t_ospf6_cfg);
+ event_add_timer(master, ospf6_config_finish, NULL,
+ OSPF6_PRE_CONFIG_MAX_WAIT_SECONDS, &t_ospf6_cfg);
+}
+
+static void ospf6_config_end(void)
+{
+ if (IS_OSPF6_DEBUG_EVENT)
+ zlog_debug("ospf6d config end received");
+
+ EVENT_OFF(t_ospf6_cfg);
+}
+
/* Main routine of ospf6d. Treatment of argument and starting ospf finite
state machine is handled here. */
int main(int argc, char *argv[], char *envp[])
@@ -217,6 +243,9 @@ int main(int argc, char *argv[], char *envp[])
/* initialize ospf6 */
ospf6_init(master);
+ /* Configuration processing callback initialization. */
+ cmd_init_config_callbacks(ospf6_config_start, ospf6_config_end);
+
frr_config_fork();
frr_run(master);