summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-10-30 01:09:01 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2021-10-30 02:17:45 +0200
commit6b1801a499d184cb21f3991f380f480fe10f5856 (patch)
tree1cd20c3e77422c7f0d88fc6d55c5600f5cfc95fa
parentisisd: remove useless checks when configuring ldp-sync (diff)
downloadfrr-6b1801a499d184cb21f3991f380f480fe10f5856.tar.xz
frr-6b1801a499d184cb21f3991f380f480fe10f5856.zip
isisd: simplify check to forbid area-tag modification
We can simply check whether the circuit exists already – if it exists, then we forbid the area-tag modification. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
-rw-r--r--isisd/isis_nb_config.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c
index 386ce06d0..6148cd7bf 100644
--- a/isisd/isis_nb_config.c
+++ b/isisd/isis_nb_config.c
@@ -2526,31 +2526,12 @@ int lib_interface_isis_destroy(struct nb_cb_destroy_args *args)
int lib_interface_isis_area_tag_modify(struct nb_cb_modify_args *args)
{
struct isis_circuit *circuit;
- struct interface *ifp;
- struct vrf *vrf;
- const char *area_tag, *ifname, *vrfname;
if (args->event == NB_EV_VALIDATE) {
- /* libyang doesn't like relative paths across module boundaries
- */
- ifname = yang_dnode_get_string(
- lyd_parent(lyd_parent(args->dnode)), "./name");
- vrfname = yang_dnode_get_string(
- lyd_parent(lyd_parent(args->dnode)), "./vrf");
- vrf = vrf_lookup_by_name(vrfname);
- assert(vrf);
- ifp = if_lookup_by_name(ifname, vrf->vrf_id);
-
- if (!ifp)
- return NB_OK;
-
- circuit = circuit_scan_by_ifp(ifp);
- area_tag = yang_dnode_get_string(args->dnode, NULL);
- if (circuit && circuit->area && circuit->area->area_tag
- && strcmp(circuit->area->area_tag, area_tag)) {
+ circuit = nb_running_get_entry_non_rec(lyd_parent(args->dnode), NULL, false);
+ if (circuit) {
snprintf(args->errmsg, args->errmsg_len,
- "ISIS circuit is already defined on %s",
- circuit->area->area_tag);
+ "Changing area tag is not allowed");
return NB_ERR_VALIDATION;
}
}