]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: fix "no ip ospf area"
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 13 Oct 2020 11:03:42 +0000 (14:03 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 28 Oct 2020 18:35:48 +0000 (21:35 +0300)
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>
ospfd/ospf_vty.c

index 77794c2f0575b955d54fc6d410a5ba1a8366b16a..5d7eee3f7b6ba055dea1a465d374e960631237b7 100644 (file)
@@ -8162,7 +8162,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);
@@ -8192,8 +8192,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;
 }