there are some cases where the bgp deletion will not be complete, while
the vrf identifier of the bgp instance is not completely identified. The
vrf search based on the bgp name is the better protection, since the bgp
vrf instance is created, even if the vrf identifier is not yet known.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
*/
static void bgp_if_finish(struct bgp *bgp)
{
- struct vrf *vrf = vrf_lookup_by_id(bgp->vrf_id);
+ struct vrf *vrf;
struct interface *ifp;
+ vrf = bgp_vrf_lookup_by_instance_type(bgp);
+
if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW || !vrf)
return;