summaryrefslogtreecommitdiff
path: root/lib/libfrr.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-05-07 21:01:15 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-06-19 08:43:59 -0400
commit573de11fab9c6ffd5b647ab1b9b0c23ad99fb52e (patch)
tree0e6334e50541581a7a7b74212b79fb271f86ec20 /lib/libfrr.c
parent5ede5e4eedf47c856f45849e9f8360fda4e40b92 (diff)
lib: Add ability to retry if backup is specified
If we fail to read in the config file and we have specified a backup of the backup, attempt to read that information. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/libfrr.c')
-rw-r--r--lib/libfrr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c
index 88203fbeb6..4620cb2586 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -725,7 +725,12 @@ void frr_config_fork(void)
{
hook_call(frr_late_init, master);
- vty_read_config(di->config_file, config_default);
+ if (!vty_read_config(di->config_file, config_default) &&
+ di->backup_config_file) {
+ zlog_info("Attempting to read backup config file: %s specified",
+ di->backup_config_file);
+ vty_read_config(di->backup_config_file, config_default);
+ }
/* Don't start execution if we are in dry-run mode */
if (di->dryrun)