]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ldpd: Schedule application of config till after read-in
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 15 Jun 2018 02:33:59 +0000 (22:33 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 19 Jun 2018 12:43:59 +0000 (08:43 -0400)
With commit e94b38d94b5 we are now scheduling the read
of vty config until after the startup of main thread
processing.  It now becomes necessary to move the
application of the config until after the read
in of the config from a file if we are using a
non-integrated config.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ldpd/ldpd.c

index 255febeb60344b676093a3eb6ad561e665940456..1fb9f0fb331ecedf7acb1379d39b4055b549c39f 100644 (file)
@@ -187,6 +187,22 @@ FRR_DAEMON_INFO(ldpd, LDP,
        .privs = &ldpd_privs,
 )
 
+static int ldp_config_fork_apply(struct thread *t)
+{
+       /*
+        * So the frr_config_fork() function schedules
+        * the read of the vty config( if there is a
+        * non-integrated config ) to be after the
+        * end of startup and we are starting the
+        * main process loop.  We need to schedule
+        * the application of this if necessary
+        * after the read in of the config.
+        */
+       ldp_config_apply(NULL, vty_conf);
+
+       return 0;
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -195,6 +211,7 @@ main(int argc, char *argv[])
        int                      pipe_parent2ldpe[2], pipe_parent2ldpe_sync[2];
        int                      pipe_parent2lde[2], pipe_parent2lde_sync[2];
        char                    *ctl_sock_name;
+       struct thread           *thread = NULL;
 
        ldpd_process = PROC_MAIN;
        log_procname = log_procnames[ldpd_process];
@@ -331,7 +348,7 @@ main(int argc, char *argv[])
        frr_config_fork();
 
        /* apply configuration */
-       ldp_config_apply(NULL, vty_conf);
+       thread_add_event(master, ldp_config_fork_apply, NULL, 0, &thread);
 
        /* setup pipes to children */
        if ((iev_ldpe = calloc(1, sizeof(struct imsgev))) == NULL ||