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 <iryzhov@nfware.com>
This commit is contained in:
Igor Ryzhov 2021-02-17 15:06:20 +03:00
parent eec2baa01a
commit cb3f5e1897

View File

@ -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);
}
}