diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-30 00:58:50 +0200 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-30 02:17:41 +0200 |
commit | b11f166c3e35eff799176adf6915a0b9991bd836 (patch) | |
tree | 591b4b36f591f1b598ff2e9e2b570b0755c11cca /isisd | |
parent | isisd: remove useless checks when configuring passive interfaces (diff) | |
download | frr-b11f166c3e35eff799176adf6915a0b9991bd836.tar.xz frr-b11f166c3e35eff799176adf6915a0b9991bd836.zip |
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 <iryzhov@nfware.com>
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_ldp_sync.c | 3 | ||||
-rw-r--r-- | 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 62d8b8334..9d494121c 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 f54ee75ed..386ce06d0 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; |