From 4c80d4ccba7fe6763997a5bf64a317044e257b1a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 1 Jun 2018 14:23:44 -0400 Subject: [PATCH] bgpd: Remove AGGREGATE_NEXTHOP_CHECK as it's been unused The #define AGGREGATE_NEXTHOP_CHECK has not been used for a very very long time. Since this is effectively dead code, let's remove it. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index e0484271bb..3976205b0e 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -5447,24 +5447,12 @@ static void bgp_aggregate_route(struct bgp *bgp, struct prefix *p, struct aspath *asmerge = NULL; struct community *community = NULL; struct community *commerge = NULL; -#if defined(AGGREGATE_NEXTHOP_CHECK) - struct in_addr nexthop; - uint32_t med = 0; -#endif struct bgp_info *ri; struct bgp_info *new; int first = 1; unsigned long match = 0; uint8_t atomic_aggregate = 0; - /* Record adding route's nexthop and med. */ - if (rinew) { -#if defined(AGGREGATE_NEXTHOP_CHECK) - nexthop = rinew->attr->nexthop; - med = rinew->attr->med; -#endif - } - /* ORIGIN attribute: If at least one route among routes that are aggregated has ORIGIN with the value INCOMPLETE, then the aggregated route must have the ORIGIN attribute with the value @@ -5490,27 +5478,8 @@ static void bgp_aggregate_route(struct bgp *bgp, struct prefix *p, if (del && ri == del) continue; - if (!rinew && first) { -#if defined(AGGREGATE_NEXTHOP_CHECK) - nexthop = ri->attr->nexthop; - med = ri->attr->med; -#endif + if (!rinew && first) first = 0; - } - -#ifdef AGGREGATE_NEXTHOP_CHECK - if (!IPV4_ADDR_SAME(&ri->attr->nexthop, - &nexthop) - || ri->attr->med != med) { - if (aspath) - aspath_free(aspath); - if (community) - community_free(community); - bgp_unlock_node(rn); - bgp_unlock_node(top); - return; - } -#endif /* AGGREGATE_NEXTHOP_CHECK */ if (ri->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE)) -- 2.39.5