From 8fcdc286aea3c1893fd2fabeb88bec0282b0fdab Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Sat, 30 Oct 2021 01:33:01 +0300 Subject: [PATCH] isisd: don't remove interface config when isis router is deleted MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In previous releases, it was not possible to configure ISIS on an interfaces without configuring the ISIS router first. Therefore, we had to delete the ISIS config from all interfaces when the router config was deleted. This is fixed since version 8.0 – interface and router configs are completely separate and don't depend on each other, so now we can remove this hack and preserve the interface config when the router config is deleted. Signed-off-by: Igor Ryzhov --- isisd/isis_cli.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 195a3fcd2f..96ca074b86 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -70,43 +70,12 @@ DEFPY_YANG_NOSH(router_isis, router_isis_cmd, return ret; } -struct if_iter { - struct vty *vty; - const char *tag; -}; - -static int if_iter_cb(const struct lyd_node *dnode, void *arg) -{ - struct if_iter *iter = arg; - const char *tag; - - if (!yang_dnode_exists(dnode, "frr-isisd:isis/area-tag")) - return YANG_ITER_CONTINUE; - - tag = yang_dnode_get_string(dnode, "frr-isisd:isis/area-tag"); - if (strmatch(tag, iter->tag)) { - char xpath[XPATH_MAXLEN]; - const char *name = yang_dnode_get_string(dnode, "name"); - const char *vrf = yang_dnode_get_string(dnode, "vrf"); - - snprintf( - xpath, XPATH_MAXLEN, - "/frr-interface:lib/interface[name='%s'][vrf='%s']/frr-isisd:isis", - name, vrf); - nb_cli_enqueue_change(iter->vty, xpath, NB_OP_DESTROY, NULL); - } - - return YANG_ITER_CONTINUE; -} - DEFPY_YANG(no_router_isis, no_router_isis_cmd, "no router isis WORD$tag [vrf NAME$vrf_name]", NO_STR ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag\n" VRF_CMD_HELP_STR) { - struct if_iter iter; - if (!vrf_name) vrf_name = VRF_DEFAULT_NAME; @@ -118,12 +87,6 @@ DEFPY_YANG(no_router_isis, no_router_isis_cmd, return CMD_ERR_NOTHING_TODO; } - iter.vty = vty; - iter.tag = tag; - - yang_dnode_iterate(if_iter_cb, &iter, vty->candidate_config->dnode, - "/frr-interface:lib/interface[vrf='%s']", vrf_name); - nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL); return nb_cli_apply_changes_clear_pending( -- 2.39.5