From cb3f5e1897dc94a840ff6158c8b3b85acf59657f Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 17 Feb 2021 15:06:20 +0300 Subject: [PATCH] staticd: fix vrf enabling 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 --- staticd/static_routes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/staticd/static_routes.c b/staticd/static_routes.c index 3a6afabb34..9f7e19660d 100644 --- a/staticd/static_routes.c +++ b/staticd/static_routes.c @@ -509,6 +509,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); } }