diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-15 04:33:59 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-19 14:43:59 +0200 |
commit | 9124048d0e01718899ac4fd591b74d5422780b8f (patch) | |
tree | 0989f1d595ac4ecd5c8db3c02a98a397c41dbf8a /ldpd/ldpd.c | |
parent | lib: Create a thread for reading in the cli (diff) | |
download | frr-9124048d0e01718899ac4fd591b74d5422780b8f.tar.xz frr-9124048d0e01718899ac4fd591b74d5422780b8f.zip |
ldpd: Schedule application of config till after read-in
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>
Diffstat (limited to 'ldpd/ldpd.c')
-rw-r--r-- | ldpd/ldpd.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c index 255febeb6..1fb9f0fb3 100644 --- a/ldpd/ldpd.c +++ b/ldpd/ldpd.c @@ -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 || |