summaryrefslogtreecommitdiffstats
path: root/isisd/isis_cli.c
diff options
context:
space:
mode:
authorEmanuele Di Pascale <emanuele@voltanet.io>2018-12-10 14:54:48 +0100
committerEmanuele Di Pascale <emanuele@voltanet.io>2018-12-18 15:25:57 +0100
commit4ecc4b46acbf14bb26f9309ce9a9bbcb968971a9 (patch)
tree88db92482a84b573dbf81f229ae3ccb02b7b3396 /isisd/isis_cli.c
parentisisd: retrieve default values from the yang model (diff)
downloadfrr-4ecc4b46acbf14bb26f9309ce9a9bbcb968971a9.tar.xz
frr-4ecc4b46acbf14bb26f9309ce9a9bbcb968971a9.zip
isisd: fix 'no router isis' on candidate config
if we are using the transactional CLI, we might be trying to delete an area that has not been actually created in isisd. So rather than relying on isis_area_lookup, check the candidate config for the presence of the corresponding area instance. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to '')
-rw-r--r--isisd/isis_cli.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c
index e4006fb3b..4edd77f8a 100644
--- a/isisd/isis_cli.c
+++ b/isisd/isis_cli.c
@@ -82,14 +82,16 @@ DEFPY(no_router_isis, no_router_isis_cmd, "no router isis WORD$tag",
struct isis_circuit *circuit = NULL;
struct isis_area *area = NULL;
- area = isis_area_lookup(tag);
- if (!area) {
+ if (!yang_dnode_exists(vty->candidate_config->dnode,
+ "/frr-isisd:isis/instance[area-tag='%s']",
+ tag)) {
vty_out(vty, "ISIS area %s not found.\n", tag);
return CMD_ERR_NOTHING_TODO;
}
nb_cli_enqueue_change(vty, ".", NB_OP_DELETE, NULL);
- if (area->circuit_list && listcount(area->circuit_list)) {
+ area = isis_area_lookup(tag);
+ if (area && area->circuit_list && listcount(area->circuit_list)) {
for (ALL_LIST_ELEMENTS(area->circuit_list, node, nnode,
circuit)) {
/* add callbacks to delete each of the circuits listed
@@ -273,20 +275,13 @@ DEFPY(no_ip_router_isis, no_ip_router_isis_cmd,
{
const struct lyd_node *dnode =
yang_dnode_get(running_config->dnode, VTY_CURR_XPATH);
- struct interface *ifp;
- struct isis_circuit *circuit = NULL;
-
- /* check for the existance of a circuit */
- if (dnode) {
- ifp = yang_dnode_get_entry(dnode, false);
- if (ifp)
- circuit = circuit_scan_by_ifp(ifp);
- }
/* if both ipv4 and ipv6 are off delete the interface isis container too
*/
if (!strncmp(ip, "ipv6", strlen("ipv6"))) {
- if (circuit && !circuit->ip_router)
+ if (dnode
+ && !yang_dnode_get_bool(dnode,
+ "./frr-isisd:isis/ipv4-routing"))
nb_cli_enqueue_change(vty, "./frr-isisd:isis",
NB_OP_DELETE, NULL);
else
@@ -294,7 +289,9 @@ DEFPY(no_ip_router_isis, no_ip_router_isis_cmd,
"./frr-isisd:isis/ipv6-routing",
NB_OP_MODIFY, "false");
} else { /* no ipv4 */
- if (circuit && !circuit->ipv6_router)
+ if (dnode
+ && !yang_dnode_get_bool(dnode,
+ "./frr-isisd:isis/ipv6-routing"))
nb_cli_enqueue_change(vty, "./frr-isisd:isis",
NB_OP_DELETE, NULL);
else