]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: complete description code for communities 3133/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 4 Oct 2018 18:10:09 +0000 (18:10 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 4 Oct 2018 18:12:33 +0000 (18:12 +0000)
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 <qlyoung@cumulusnetworks.com>
bgpd/bgp_route.c

index 755e9b7f97c5f664cea0980e54d5a1130a0e0566..1693147b8924b2b6185da0362ea39ebd619c1539 100644 (file)
@@ -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);
                }
        }