]> git.puffer.fish Git - matthieu/frr.git/commitdiff
staticd: fix vrf enabling
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 17 Feb 2021 12:06:20 +0000 (15:06 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 26 Feb 2021 11:35:24 +0000 (14:35 +0300)
When enabling the VRF, we should not install the nexthops that rely on
non-existent VRF.

For example, if we have route "1.1.1.0/24 2.2.2.2 vrf red nexthop-vrf blue",
and VRF red is enabled, we should not install it if VRF blue doesn't exist.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
staticd/static_routes.c

index 7689f54412575404804dff9fe9f6ffe9e1933392..a4fe1baea854c0eff5f2aa85db23a4490ffaf051 100644 (file)
@@ -495,6 +495,8 @@ static void static_enable_vrf(struct static_vrf *svrf,
                                        else
                                                continue;
                                }
+                               if (nh->nh_vrf_id == VRF_UNKNOWN)
+                                       continue;
                                static_install_path(rn, pn, safi, svrf);
                        }
                }