From cee9c03192ca785076aebe00d5e62cf22122ff07 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 4 Oct 2018 18:10:09 +0000 Subject: [PATCH] bgpd: complete description code for communities When this description code was added, it was all dead code since none of the bools that checked if the communities were present were ever changed from 0. Signed-off-by: Quentin Young --- bgpd/bgp_route.c | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 755e9b7f97..1693147b89 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -8666,17 +8666,39 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp, best = count; if (ri->extra && ri->extra->suppress) suppress = 1; - if (ri->attr->community != NULL) { - if (community_include(ri->attr->community, - COMMUNITY_NO_ADVERTISE)) - no_advertise = 1; - if (community_include(ri->attr->community, - COMMUNITY_NO_EXPORT)) - no_export = 1; - if (community_include(ri->attr->community, - COMMUNITY_LOCAL_AS)) - local_as = 1; - } + + if (ri->attr->community == NULL) + continue; + + no_advertise += community_include( + ri->attr->community, COMMUNITY_NO_ADVERTISE); + no_export += community_include(ri->attr->community, + COMMUNITY_NO_EXPORT); + local_as += community_include(ri->attr->community, + COMMUNITY_LOCAL_AS); + accept_own += community_include(ri->attr->community, + COMMUNITY_ACCEPT_OWN); + route_filter_translated_v4 += community_include( + ri->attr->community, + COMMUNITY_ROUTE_FILTER_TRANSLATED_v4); + route_filter_translated_v6 += community_include( + ri->attr->community, + COMMUNITY_ROUTE_FILTER_TRANSLATED_v6); + route_filter_v4 += community_include( + ri->attr->community, COMMUNITY_ROUTE_FILTER_v4); + route_filter_v6 += community_include( + ri->attr->community, COMMUNITY_ROUTE_FILTER_v6); + llgr_stale += community_include(ri->attr->community, + COMMUNITY_LLGR_STALE); + no_llgr += community_include(ri->attr->community, + COMMUNITY_NO_LLGR); + accept_own_nexthop += + community_include(ri->attr->community, + COMMUNITY_ACCEPT_OWN_NEXTHOP); + blackhole += community_include(ri->attr->community, + COMMUNITY_BLACKHOLE); + no_peer += community_include(ri->attr->community, + COMMUNITY_NO_PEER); } } -- 2.39.5