diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-05-20 02:40:32 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-05-20 02:40:32 +0200 |
commit | 6dae198f69574235529431a067850cd01318dbbc (patch) | |
tree | 6124e8f2b84c593aff8f4cb414d30cc881c433e3 /ospfd/ospf_main.c | |
parent | cluster-id length equality for multipath (diff) | |
download | frr-6dae198f69574235529431a067850cd01318dbbc.tar.xz frr-6dae198f69574235529431a067850cd01318dbbc.zip |
ospfd: ospfv2-fix-interface-mode-cmd.patch
SYMPTOM:
Interface mode OSPF area configuration is not retained after restarting quagga.
Example -
quagga(config)# interface swp49
quagga(config-if)# ip ospf area 0.0.0.0
quagga# sh run
<snip>
interface swp49
ip ospf area 0.0.0.0
ipv6 nd suppress-ra
link-detect
!
quagga# write memory
* Restart quagga at this point*
quagga# sh run
<snip>
interface swp49
ipv6 nd suppress-ra
link-detect
!
ISSUE:
The issue is that the interface mode commands can reach the OSPF process even
before 'router ospf' command that initializes the default OSPF instance, this
is not getting handled properly in OSPF process.
FIX:
Initialize the default OSPF instance during OSPF process initializations, which
is before 'router ospf' command is received in OSPF process. So, when interface
mode command is received, it is guaranteed to have ospf instance to work with.
Other way could be to call ospf_get() instead of ospf_lookup() while processing
the config command callbacks, although OSPF needs to have at least one instance
structure anyways, therefore calling it unconditionally in OSPF initializations
should be fine too.
There could be more elaborate fix(es) possible to handle this, like adding some
ordering mechanism for commands as they are read by a process, or storing the
received command and applying it after the commands its dependent upon are
processed. For the issue at hand, initializing the default instance in main()
serves the purpose well.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_main.c')
-rw-r--r-- | ospfd/ospf_main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 82735b731..96dfd5799 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -310,6 +310,15 @@ main (int argc, char **argv) ospf_opaque_init (); #endif /* HAVE_OPAQUE_LSA */ + /* Need to initialize the default ospf structure, so the interface mode + commands can be duly processed if they are received before 'router ospf', + when quagga(ospfd) is restarted */ + if (!ospf_get()) + { + zlog_err("OSPF instance init failed: %s", strerror(errno)); + exit (1); + } + /* Get configuration file. */ vty_read_config (config_file, config_default); |