From b11f166c3e35eff799176adf6915a0b9991bd836 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Sat, 30 Oct 2021 01:58:50 +0300 Subject: [PATCH] isisd: remove useless checks when configuring ldp-sync We have checks on NB validation stage to prevent configuring LDP sync on interfaces in non-default VRFs. These checks are completely useless, because the interface can be easily moved to another VRF after configuring LDP sync. Instead, the check must be done in the actual code to cover the case when the interface is moved between VRFs. Signed-off-by: Igor Ryzhov --- isisd/isis_ldp_sync.c | 3 +++ isisd/isis_nb_config.c | 30 ------------------------------ 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/isisd/isis_ldp_sync.c b/isisd/isis_ldp_sync.c index 62d8b8334a..9d494121c8 100644 --- a/isisd/isis_ldp_sync.c +++ b/isisd/isis_ldp_sync.c @@ -486,6 +486,9 @@ void isis_if_ldp_sync_enable(struct isis_circuit *circuit) if (if_is_loopback(circuit->interface)) return; + if (circuit->interface->vrf->vrf_id != VRF_DEFAULT) + return; + ils_debug("ldp_sync: enable if %s", circuit->interface->name); if (!CHECK_FLAG(area->ldp_sync_cmd.flags, LDP_SYNC_FLAG_ENABLE)) diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index f54ee75ede..386ce06d09 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -3188,19 +3188,9 @@ int lib_interface_isis_mpls_ldp_sync_modify(struct nb_cb_modify_args *args) struct isis_circuit *circuit; struct ldp_sync_info *ldp_sync_info; bool ldp_sync_enable; - const char *vrfname; switch (args->event) { case NB_EV_VALIDATE: - vrfname = yang_dnode_get_string( - lyd_parent(lyd_parent(lyd_parent(args->dnode))), - "./vrf"); - if (strcmp(vrfname, VRF_DEFAULT_NAME)) { - snprintf(args->errmsg, args->errmsg_len, - "LDP-Sync only runs on Default VRF"); - return NB_ERR_VALIDATION; - } - break; case NB_EV_PREPARE: case NB_EV_ABORT: break; @@ -3232,19 +3222,9 @@ int lib_interface_isis_mpls_holddown_modify(struct nb_cb_modify_args *args) struct isis_circuit *circuit; struct ldp_sync_info *ldp_sync_info; uint16_t holddown; - const char *vrfname; switch (args->event) { case NB_EV_VALIDATE: - vrfname = yang_dnode_get_string( - lyd_parent(lyd_parent(lyd_parent(args->dnode))), - "./vrf"); - if (strcmp(vrfname, VRF_DEFAULT_NAME)) { - snprintf(args->errmsg, args->errmsg_len, - "LDP-Sync only runs on Default VRF"); - return NB_ERR_VALIDATION; - } - break; case NB_EV_PREPARE: case NB_EV_ABORT: break; @@ -3265,19 +3245,9 @@ int lib_interface_isis_mpls_holddown_destroy(struct nb_cb_destroy_args *args) { struct isis_circuit *circuit; struct ldp_sync_info *ldp_sync_info; - const char *vrfname; switch (args->event) { case NB_EV_VALIDATE: - vrfname = yang_dnode_get_string( - lyd_parent(lyd_parent(lyd_parent(args->dnode))), - "./vrf"); - if (strcmp(vrfname, VRF_DEFAULT_NAME)) { - snprintf(args->errmsg, args->errmsg_len, - "LDP-Sync only runs on Default VRF"); - return NB_ERR_VALIDATION; - } - break; case NB_EV_PREPARE: case NB_EV_ABORT: break; -- 2.39.5