diff options
Diffstat (limited to 'ospfd/ospf_vty.c')
| -rw-r--r-- | ospfd/ospf_vty.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index e6835ffc72..f7bef89b30 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -577,6 +577,7 @@ DEFUN (ospf_network_area, struct prefix_ipv4 p; struct in_addr area_id; int ret, format; + uint32_t count; if (ospf->instance) { vty_out(vty, @@ -584,14 +585,15 @@ DEFUN (ospf_network_area, return CMD_WARNING_CONFIG_FAILED; } - if (ospf->if_ospf_cli_count > 0) { + count = ospf_count_area_params(ospf); + if (count > 0) { vty_out(vty, "Please remove all ip ospf area x.x.x.x commands first.\n"); if (IS_DEBUG_OSPF_EVENT) zlog_debug( "%s ospf vrf %s num of %u ip ospf area x config", __func__, ospf->name ? ospf->name : "NIL", - ospf->if_ospf_cli_count); + count); return CMD_WARNING_CONFIG_FAILED; } @@ -8821,10 +8823,8 @@ DEFUN (ip_ospf_area, if (count > 0) { ospf = ospf_lookup_by_vrf_id(ifp->vrf_id); - if (ospf) { + if (ospf) ospf_interface_area_unset(ospf, ifp); - ospf->if_ospf_cli_count -= count; - } } return CMD_NOT_MY_INSTANCE; @@ -8882,10 +8882,8 @@ DEFUN (ip_ospf_area, params->if_area_id_fmt = format; } - if (ospf) { + if (ospf) ospf_interface_area_set(ospf, ifp); - ospf->if_ospf_cli_count++; - } return CMD_SUCCESS; } @@ -8951,7 +8949,6 @@ DEFUN (no_ip_ospf_area, if (ospf) { ospf_interface_area_unset(ospf, ifp); - ospf->if_ospf_cli_count--; ospf_area_check_free(ospf, area_id); } |
