]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: fix using vrf interface as a loopback
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 28 May 2021 15:45:40 +0000 (18:45 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 8 Jun 2021 17:44:22 +0000 (20:44 +0300)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
isisd/isis_circuit.c
isisd/isis_cli.c
isisd/isis_nb_config.c

index 2a197ab2b71bf56137ef0f1e1da38304f8d8daa8..4fa28a4ad91a2d92fc13c670e59c170245c682d3 100644 (file)
@@ -497,7 +497,7 @@ void isis_circuit_if_add(struct isis_circuit *circuit, struct interface *ifp)
                        circuit->circ_type = CIRCUIT_T_BROADCAST;
        } else if (if_is_pointopoint(ifp)) {
                circuit->circ_type = CIRCUIT_T_P2P;
-       } else if (if_is_loopback(ifp)) {
+       } else if (if_is_loopback_or_vrf(ifp)) {
                circuit->circ_type = CIRCUIT_T_LOOPBACK;
                circuit->is_passive = 1;
        } else {
@@ -1350,7 +1350,7 @@ ferr_r isis_circuit_passive_set(struct isis_circuit *circuit, bool passive)
        if (circuit->is_passive == passive)
                return ferr_ok();
 
-       if (if_is_loopback(circuit->interface) && !passive)
+       if (if_is_loopback_or_vrf(circuit->interface) && !passive)
                return ferr_cfg_invalid("loopback is always passive");
 
        if (circuit->state != C_STATE_UP) {
index c3b250e7c5648b2f5bd9ee7ac206588d826cbde6..366d544d1f70b3dc32979d923882a6ccdcc5b43a 100644 (file)
@@ -195,7 +195,7 @@ DEFPY_YANG(ip_router_isis, ip_router_isis_cmd,
 
        /* check if the interface is a loopback and if so set it as passive */
        ifp = nb_running_get_entry(NULL, VTY_CURR_XPATH, false);
-       if (ifp && if_is_loopback(ifp))
+       if (ifp && if_is_loopback_or_vrf(ifp))
                nb_cli_enqueue_change(vty, "./frr-isisd:isis/passive",
                                      NB_OP_MODIFY, "true");
 
@@ -252,7 +252,7 @@ DEFPY_YANG(ip6_router_isis, ip6_router_isis_cmd,
 
        /* check if the interface is a loopback and if so set it as passive */
        ifp = nb_running_get_entry(NULL, VTY_CURR_XPATH, false);
-       if (ifp && if_is_loopback(ifp))
+       if (ifp && if_is_loopback_or_vrf(ifp))
                nb_cli_enqueue_change(vty, "./frr-isisd:isis/passive",
                                      NB_OP_MODIFY, "true");
 
index a00c86eeaf1af5139a8dd4ef57616f4f9b2eff24..2622c5b51b7856e136fb644f0e902690506152ef 100644 (file)
@@ -2966,7 +2966,7 @@ int lib_interface_isis_passive_modify(struct nb_cb_modify_args *args)
                ifp = circuit->interface;
                if (!ifp)
                        return NB_OK;
-               if (if_is_loopback(ifp)) {
+               if (if_is_loopback_or_vrf(ifp)) {
                        snprintf(args->errmsg, args->errmsg_len,
                                 "Loopback is always passive");
                        return NB_ERR_VALIDATION;