]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd: remove useless checks when configuring ldp-sync
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 29 Oct 2021 22:58:50 +0000 (01:58 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Sat, 30 Oct 2021 00:17:41 +0000 (03:17 +0300)
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>
isisd/isis_ldp_sync.c
isisd/isis_nb_config.c

index 62d8b8334ae85e7265c5e6712a39fcafe1e414e4..9d494121c853a474c4363958bec60e6ef221bde9 100644 (file)
@@ -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))
index f54ee75ede0d3555f449be55b44f25c73f03b60c..386ce06d0988dedf13a261bf7e8ae47dc0b8d526 100644 (file)
@@ -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;