From ee66b77f0e8df69034a15564cc433e70b5adb65e Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Mon, 11 Feb 2019 14:04:52 +0100 Subject: [PATCH] bgpd: if vrf is unknown, bgp deletion not complete 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 --- bgpd/bgpd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index aceb990534..0ff9d75781 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -7857,9 +7857,11 @@ void bgp_master_init(struct thread_master *master) */ 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; -- 2.39.5