From b89a6450ba6f46d39b5b267e4f23cd45fb1eba46 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 1 Jun 2018 14:19:12 -0400 Subject: [PATCH] bgpd: Trust the bgp_table_top_nolock for aggregates The safi passed in to short-circuit the aggregate lookup adds code complexity and little speed improvements for the case where we actually may have aggregates configured! Since bgp_table_top_nolock() actually tells us if there are any aggregates installed and safely returns if there is nothing to do, trust it. As that we know for those safi's were we don't want to have, we dissallow the creation via the cli anyways. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 73331f8eee..e0484271bb 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -5628,12 +5628,6 @@ void bgp_aggregate_increment(struct bgp *bgp, struct prefix *p, struct bgp_aggregate *aggregate; struct bgp_table *table; - /* MPLS-VPN aggregation is not yet supported. */ - if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP) - || (safi == SAFI_EVPN) - || (safi == SAFI_FLOWSPEC)) - return; - table = bgp->aggregate[afi][safi]; /* No aggregates configured. */ @@ -5667,12 +5661,6 @@ void bgp_aggregate_decrement(struct bgp *bgp, struct prefix *p, struct bgp_aggregate *aggregate; struct bgp_table *table; - /* MPLS-VPN aggregation is not yet supported. */ - if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP) - || (safi == SAFI_EVPN) - || (safi == SAFI_FLOWSPEC)) - return; - table = bgp->aggregate[afi][safi]; /* No aggregates configured. */ -- 2.39.5