mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 09:52:27 +00:00
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>
This commit is contained in:
parent
0b70cb101c
commit
fe64533ad9
@ -745,9 +745,14 @@ static int frr_config_read_in(struct thread *t)
|
|||||||
{
|
{
|
||||||
if (!vty_read_config(di->config_file, config_default) &&
|
if (!vty_read_config(di->config_file, config_default) &&
|
||||||
di->backup_config_file) {
|
di->backup_config_file) {
|
||||||
|
char *orig = XSTRDUP(MTYPE_TMP, host_config_get());
|
||||||
|
|
||||||
zlog_info("Attempting to read backup config file: %s specified",
|
zlog_info("Attempting to read backup config file: %s specified",
|
||||||
di->backup_config_file);
|
di->backup_config_file);
|
||||||
vty_read_config(di->backup_config_file, config_default);
|
vty_read_config(di->backup_config_file, config_default);
|
||||||
|
|
||||||
|
host_config_set(orig);
|
||||||
|
XFREE(MTYPE_TMP, orig);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user