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 <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2025-03-03 17:21:19 +01:00
parent bccf1e5447
commit 32088c43a8

View File

@ -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);
}
}
}