]> git.puffer.fish Git - mirror/frr.git/commitdiff
staticd: Enable backup config
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 May 2018 12:12:41 +0000 (08:12 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sun, 29 Jul 2018 16:37:26 +0000 (12:37 -0400)
When the user is not using the integrated config and
has upgraded to a version of FRR with staticd, that
probably means that static routes are stored in zebra.conf.
Take advantage of the backup backup config option and read
those in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
staticd/static_main.c

index 7da526cefd491fb88e0dc6f557cd2c1aff5aa114..842de6af46c5d30f40efe1c047a5a6d757b19337 100644 (file)
@@ -36,6 +36,8 @@
 #include "static_routes.h"
 #include "static_zebra.h"
 
+char backup_config_file[256];
+
 bool mpls_enabled;
 
 zebra_capabilities_t _caps_p[] = {
@@ -137,6 +139,10 @@ int main(int argc, char **argv, char **envp)
        static_zebra_init();
        static_vty_init();
 
+       snprintf(backup_config_file, sizeof(backup_config_file),
+                "%s/zebra.conf", frr_sysconfdir);
+       staticd_di.backup_config_file = backup_config_file;
+
        frr_config_fork();
        frr_run(master);