Skip to content

Commit

Permalink
bgpd: fix withdraw stale routes
Browse files Browse the repository at this point in the history
Incoming MPLS VPN staled routes are not flushing imported
entries, upon expiration of the stalepath timer.

The incoming MPLS VPN staled routes that are received from
a given peer have a sub_type set to BGP_ROUTE_NORMAL. The
original patch is wrong as it filters out the locally
exported routes marked with the BGP_ROUTE_IMPORTED subtype.

Fix this by extending the test to all MPLS VPN routes
received from this peer.

Fixes: 641065d ("bgpd: VRF-Lite fix to clear stale leaked routes")

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Dec 4, 2023
1 parent 6be9452 commit 5b41a0e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -5858,8 +5858,7 @@ void bgp_clear_stale_route(struct peer *peer, afi_t afi, safi_t safi)
* If this is VRF leaked route
* process for withdraw.
*/
if (pi->sub_type ==
BGP_ROUTE_IMPORTED &&
if (safi == SAFI_MPLS_VPN &&
peer->bgp->inst_type ==
BGP_INSTANCE_TYPE_DEFAULT)
vpn_leak_to_vrf_withdraw(pi);
Expand Down

0 comments on commit 5b41a0e

Please sign in to comment.