]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix remove vpn aggregated prefix upon unconfiguration
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 3 Mar 2025 16:21:19 +0000 (17:21 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 3 Mar 2025 19:43:11 +0000 (20:43 +0100)
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>
bgpd/bgp_route.c

index 3bbbdee16170ee595fbf1e88c755e6a6217bf24b..910fa97493d1997fc312356d86cda640c92ecbaf 100644 (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);
+                               }
                        }
        }