]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #5765 from Spantik/bugs
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 6 Feb 2020 12:27:27 +0000 (07:27 -0500)
committerGitHub <noreply@github.com>
Thu, 6 Feb 2020 12:27:27 +0000 (07:27 -0500)
OSPF: Multi instance broken

ospfd/ospf_main.c

index 7caa79d20744a67d779608edd49c255d11b79488..9cde64bc38b50d4f1dbf1b165a94926f46ee499d 100644 (file)
@@ -143,6 +143,7 @@ FRR_DAEMON_INFO(ospfd, OSPF, .vty_port = OSPF_VTY_PORT,
 int main(int argc, char **argv)
 {
        unsigned short instance = 0;
+       bool created = false;
 
 #ifdef SUPPORT_OSPF_API
        /* OSPF apiserver is disabled by default. */
@@ -219,6 +220,17 @@ int main(int argc, char **argv)
        /* OSPF errors init */
        ospf_error_init();
 
+       /*
+        * Need to initialize the default ospf structure, so the interface mode
+        * commands can be duly processed if they are received before 'router
+        * ospf',  when ospfd is restarted
+        */
+       if (instance && !ospf_get_instance(instance, &created)) {
+               flog_err(EC_OSPF_INIT_FAIL, "OSPF instance init failed: %s",
+                        strerror(errno));
+               exit(1);
+       }
+
        frr_config_fork();
        frr_run(master);