summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2019-02-11 14:04:52 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2019-02-11 14:04:52 +0100
commitee66b77f0e8df69034a15564cc433e70b5adb65e (patch)
treefd4291cea16a82d81f7d9411bfce7a5eaf87d0d1
parentfb85ce1b812d892a07a4f942b4cfade9442b9a2b (diff)
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 <philippe.guibert@6wind.com>
-rw-r--r--bgpd/bgpd.c4
1 files changed, 3 insertions, 1 deletions
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;