summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.c
diff options
context:
space:
mode:
authorKantesh Mundaragi <kmundaragi@vmware.com>2021-02-19 05:48:41 +0100
committerIqra Siddiqui <imujeebsiddi@vmware.com>2022-01-08 19:21:10 +0100
commit641065d4fc0fd956252b988f8a5037b2917d9633 (patch)
tree97afc313530c6ec27f695623618a1bda6c7a37cd /bgpd/bgp_route.c
parentMerge pull request #10288 from ton31337/fix/rfc7300 (diff)
downloadfrr-641065d4fc0fd956252b988f8a5037b2917d9633.tar.xz
frr-641065d4fc0fd956252b988f8a5037b2917d9633.zip
bgpd: VRF-Lite fix to clear stale leaked routes
Description: Change is intended for fixing the issue related to clearing of stale leaked routes: - Whenever BGP goes down, after bringing down tcp connection and renegotiating capabilities, once we reestablish connection, we are not handling clear of VRF leaked route in the bgp_clear_stale_route. - While bgp is clearing stale routes, we need to handle withdraw of routes for VRF route-leaking. Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com> Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r--bgpd/bgp_route.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index fd059d3b5..3836d5f24 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -5379,6 +5379,17 @@ void bgp_clear_stale_route(struct peer *peer, afi_t afi, safi_t safi)
BGP_PATH_STALE))
break;
+ /*
+ * If this is VRF leaked route
+ * process for withdraw.
+ */
+ if (pi->sub_type ==
+ BGP_ROUTE_IMPORTED &&
+ peer->bgp->inst_type ==
+ BGP_INSTANCE_TYPE_DEFAULT)
+ vpn_leak_to_vrf_withdraw(
+ peer->bgp, pi);
+
bgp_rib_remove(rm, pi, peer, afi, safi);
break;
}
@@ -5398,6 +5409,15 @@ void bgp_clear_stale_route(struct peer *peer, afi_t afi, safi_t safi)
break;
if (!CHECK_FLAG(pi->flags, BGP_PATH_STALE))
break;
+ if (safi == SAFI_UNICAST &&
+ (peer->bgp->inst_type ==
+ BGP_INSTANCE_TYPE_VRF ||
+ peer->bgp->inst_type ==
+ BGP_INSTANCE_TYPE_DEFAULT))
+ vpn_leak_from_vrf_withdraw(
+ bgp_get_default(), peer->bgp,
+ pi);
+
bgp_rib_remove(dest, pi, peer, afi, safi);
break;
}