From cc5a6ddd066d15d79ecc1a2d8f48a3ce9d592ed7 Mon Sep 17 00:00:00 2001 From: vivek Date: Wed, 28 Mar 2018 22:13:05 -0700 Subject: [PATCH] bgpd: Enhance loop checking for VRF to VPN route export The VRF routes exported to the global VPN table must not be imported routes. It is not necessary to check if they originate in the global VPN instance as that doesn't hold good for VRF-to- VRF route-leaking. Merely checking that they are not imported should handle both L3VPN and VRF-to-VRF route-leaking use cases. Ticket: CM-20283 Signed-off-by: Vivek Venkatraman --- bgpd/bgp_mplsvpn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 5038151752..fb15f90c28 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -654,8 +654,8 @@ void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */ return; } - /* loop check */ - if (info_vrf->extra && info_vrf->extra->bgp_orig == bgp_vpn) + /* loop check - should not be an imported route. */ + if (info_vrf->extra && info_vrf->extra->bgp_orig) return;