diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2020-10-13 14:03:42 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2020-10-13 14:52:38 +0300 |
| commit | e4129293c77c0de4efa1d24350db784d3f5a582b (patch) | |
| tree | 41d1b50e75d65b2d2152780e9c66247857ceebe1 /ospfd/ospf_vty.c | |
| parent | 451171c09dbfa0b784193c5ee6a47e3055af4cf5 (diff) | |
ospfd: fix "no ip ospf area"
This commit fixes the following behavior:
```
nfware(config)# interface enp2s0
nfware(config-if)# ip ospf area 0
nfware(config-if)# no ip ospf area 0
% [ospfd]: command ignored as it targets an instance that is not running
```
We should be able to use the command without configuring the instance.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ospfd/ospf_vty.c')
| -rw-r--r-- | ospfd/ospf_vty.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 1a9ad69ed3..ba46d1dcb0 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -8232,7 +8232,7 @@ DEFUN (no_ip_ospf_area, else ospf = ospf_lookup_instance(instance); - if (ospf == NULL) + if (instance && ospf == NULL) return CMD_NOT_MY_INSTANCE; argv_find(argv, argc, "area", &idx); @@ -8262,8 +8262,11 @@ DEFUN (no_ip_ospf_area, ospf_if_update_params((ifp), (addr)); } - ospf_interface_area_unset(ospf, ifp); - ospf->if_ospf_cli_count--; + if (ospf) { + ospf_interface_area_unset(ospf, ifp); + ospf->if_ospf_cli_count--; + } + return CMD_SUCCESS; } |
