summaryrefslogtreecommitdiff
path: root/lib/libfrr.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-07-19 10:09:51 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-07-29 12:43:23 -0400
commitfe64533ad9a780366ce143480c26a6ee61ea14ba (patch)
tree8169f99f24bf5235f52fefe5102a9dd31197dbcc /lib/libfrr.c
parent0b70cb101c6fea5dd79396219ecb38dc13035b1e (diff)
lib: Set proper write file when using backup config
When we read in a backup file, we should save the original host.config so that we can put it back to the correct original location after we read in the backup config. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/libfrr.c')
-rw-r--r--lib/libfrr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c
index 9ea5e985cd..86a5bd29f8 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -745,9 +745,14 @@ static int frr_config_read_in(struct thread *t)
{
if (!vty_read_config(di->config_file, config_default) &&
di->backup_config_file) {
+ char *orig = XSTRDUP(MTYPE_TMP, host_config_get());
+
zlog_info("Attempting to read backup config file: %s specified",
di->backup_config_file);
vty_read_config(di->backup_config_file, config_default);
+
+ host_config_set(orig);
+ XFREE(MTYPE_TMP, orig);
}
return 0;
}