diff options
author | Daniel Walton <dwalton@cumulusnetworks.com> | 2018-01-08 22:16:18 +0100 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2018-01-08 22:16:18 +0100 |
commit | 2b0a905a2ee0c25da73fd5f5051858e7e13c9579 (patch) | |
tree | 9941bf75845146f72320c37ebbad2596fdb39165 /ospfd/ospfd.c | |
parent | Merge pull request #1599 from chiragshah6/mdev (diff) | |
download | frr-2b0a905a2ee0c25da73fd5f5051858e7e13c9579.tar.xz frr-2b0a905a2ee0c25da73fd5f5051858e7e13c9579.zip |
ospfd: do not complain if same area is reconfigured
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Before
------
cel-redxp-10(config)# router ospf vrf RED
cel-redxp-10(config-router)# network 1.1.1.1/32 area 0.0.0.0
cel-redxp-10(config-router)# network 1.1.1.1/32 area 0.0.0.0
There is already same network statement.
cel-redxp-10(config-router)#
When we see the "There is already same network statement." message
vtysh exits non-zero. This scenario breaks frr-reload because
the command took and it in the config, it should exit zero here.
After
-----
cel-redxp-10(config)# router ospf vrf RED
cel-redxp-10(config-router)# network 1.1.1.1/32 area 0.0.0.0
cel-redxp-10(config-router)# network 1.1.1.1/32 area 0.0.0.0
cel-redxp-10(config-router)# network 1.1.1.1/32 area 0.0.0.0
cel-redxp-10(config-router)# network 1.1.1.1/32 area 0
cel-redxp-10(config-router)#
cel-redxp-10(config-router)# network 1.1.1.1/32 area 0.0.0.1
There is already same network statement.
cel-redxp-10(config-router)#
Diffstat (limited to 'ospfd/ospfd.c')
-rw-r--r-- | ospfd/ospfd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index ceb8440ee..192619743 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -1031,9 +1031,15 @@ int ospf_network_set(struct ospf *ospf, struct prefix_ipv4 *p, rn = route_node_get(ospf->networks, (struct prefix *)p); if (rn->info) { - /* There is already same network statement. */ + network = rn->info; route_unlock_node(rn); - return 0; + + if (IPV4_ADDR_SAME(&area_id, &network->area_id)) { + return 1; + } else { + /* There is already same network statement. */ + return 0; + } } rn->info = network = ospf_network_new(area_id); |