diff options
| author | Santosh P K <sapk@vmware.com> | 2020-02-05 09:40:00 -0800 |
|---|---|---|
| committer | Santosh P K <sapk@vmware.com> | 2020-02-05 09:44:49 -0800 |
| commit | 128f16f90e017edfefc49d2e09ed06a654f1940c (patch) | |
| tree | 03ebae86fdf13ed9a02353891f23835564acb04a | |
| parent | 792465c09ff7318741cd65a2e3c0aca825eededb (diff) | |
OSPF: Multi instance broken
Multi instance ospf support was broken due to PR #4564.
Adding fix back and extra checks to support multi instance
OSPF.
Fixes issues #5343 & #5741
Signed-off-by: Santosh P K <sapk@vmware.com>
| -rw-r--r-- | ospfd/ospf_main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 7caa79d207..9cde64bc38 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -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); |
