From 8a3282440b4926c13d52137e89ba7305c1a59cf2 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Mon, 27 Dec 2021 15:10:30 -0300 Subject: [PATCH] bgpd: fix aggregate route unsuppression bug Unsuppress route part of the aggregation when route-map configuration is removed before the aggregation itself. Signed-off-by: Rafael Zalamena (cherry picked from commit 92b175bd4037222e26be1f2639837bee1e200630) --- bgpd/bgp_route.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 6ad1e2b701..00cea67e15 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -7382,15 +7382,14 @@ void bgp_aggregate_delete(struct bgp *bgp, const struct prefix *p, afi_t afi, if (pi->sub_type == BGP_ROUTE_AGGREGATE) continue; - if (aggregate->summary_only && pi->extra - && AGGREGATE_MED_VALID(aggregate)) { - if (aggr_unsuppress_path(aggregate, pi)) - match++; - } - - if (aggregate->suppress_map_name - && AGGREGATE_MED_VALID(aggregate) - && aggr_suppress_map_test(bgp, aggregate, pi)) { + /* + * This route is suppressed: attempt to unsuppress it. + * + * `aggr_unsuppress_path` will fail if this particular + * aggregate route was not the suppressor. + */ + if (pi->extra && pi->extra->aggr_suppressors && + listcount(pi->extra->aggr_suppressors)) { if (aggr_unsuppress_path(aggregate, pi)) match++; } -- 2.39.5