From 32088c43a81d7e5d0ef8d21c3da15676d006a0d9 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Mon, 3 Mar 2025 17:21:19 +0100 Subject: [PATCH] bgpd: fix remove vpn aggregated prefix upon unconfiguration When unconfiguring an aggregated prefix, the VPN prefix is not removed. Fix this by refreshing the VPN leak when the aggregated route is or is not available. Signed-off-by: Philippe Guibert --- bgpd/bgp_route.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 3bbbdee161..910fa97493 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -8015,6 +8015,9 @@ static void bgp_aggregate_install( bgp_process(bgp, dest, new, afi, safi); if (debug) zlog_debug(" aggregate %pFX: installed", p); + if (SAFI_UNICAST == safi && (bgp->inst_type == BGP_INSTANCE_TYPE_VRF || + bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)) + vpn_leak_from_vrf_update(bgp_get_default(), bgp, new); } else { uninstall_aggregate_route: /* Withdraw the aggregate route from routing table. */ @@ -8023,6 +8026,11 @@ static void bgp_aggregate_install( bgp_process(bgp, dest, pi, afi, safi); if (debug) zlog_debug(" aggregate %pFX: uninstall", p); + if (SAFI_UNICAST == safi && + (bgp->inst_type == BGP_INSTANCE_TYPE_VRF || + bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)) { + vpn_leak_from_vrf_withdraw(bgp_get_default(), bgp, pi); + } } } -- 2.39.5