summaryrefslogtreecommitdiff
path: root/isisd/isis_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'isisd/isis_main.c')
-rw-r--r--isisd/isis_main.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/isisd/isis_main.c b/isisd/isis_main.c
index 9b2bebb420..25ea187492 100644
--- a/isisd/isis_main.c
+++ b/isisd/isis_main.c
@@ -168,6 +168,40 @@ static const struct frr_yang_module_info *const isisd_yang_modules[] = {
};
/* clang-format on */
+
+static void isis_config_finish(struct thread *t)
+{
+ struct listnode *node, *inode;
+ struct isis *isis;
+ struct isis_area *area;
+
+ for (ALL_LIST_ELEMENTS_RO(im->isis, inode, isis)) {
+ for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area))
+ config_end_lsp_generate(area);
+ }
+}
+
+static void isis_config_start(void)
+{
+ /* Max wait time for config to load before generating lsp */
+#define ISIS_PRE_CONFIG_MAX_WAIT_SECONDS 600
+ THREAD_OFF(t_isis_cfg);
+ thread_add_timer(im->master, isis_config_finish, NULL,
+ ISIS_PRE_CONFIG_MAX_WAIT_SECONDS, &t_isis_cfg);
+}
+
+static void isis_config_end(void)
+{
+ /* If ISIS config processing thread isn't running, then
+ * we can return and rely it's properly handled.
+ */
+ if (!thread_is_scheduled(t_isis_cfg))
+ return;
+
+ THREAD_OFF(t_isis_cfg);
+ isis_config_finish(t_isis_cfg);
+}
+
#ifdef FABRICD
FRR_DAEMON_INFO(fabricd, OPEN_FABRIC, .vty_port = FABRICD_VTY_PORT,
@@ -231,6 +265,7 @@ int main(int argc, char **argv, char **envp)
/*
* initializations
*/
+ cmd_init_config_callbacks(isis_config_start, isis_config_end);
isis_error_init();
access_list_init();
access_list_add_hook(isis_filter_update);