Skip to content

Commit

Permalink
lib: Set proper write file when using backup config
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
donaldsharp committed Jul 25, 2018
1 parent 0c7e6c7 commit d4c9876
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/libfrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d4c9876

Please sign in to comment.