]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Set proper write file when using backup config
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 19 Jul 2018 14:09:51 +0000 (10:09 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sun, 29 Jul 2018 16:43:23 +0000 (12:43 -0400)
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>
lib/libfrr.c

index 9ea5e985cd424ab631362335ef33cdb7da5715c6..86a5bd29f81c854cb8c579bd41d4883490e426b9 100644 (file)
@@ -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;
 }