]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Move bgp_aggregate_delete to a better location
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 6 Jun 2018 16:46:14 +0000 (12:46 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 6 Jun 2018 16:46:14 +0000 (12:46 -0400)
The function bgp_aggregate_delete function was forward
declared and not static.  Move it so we can clean that
up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_route.c

index 3d5513e0c94e78d78a1af84c2caee7a14f27e7a9..ed71f4197f79f50c6366aca85a7cb5b9145e0611 100644 (file)
@@ -5610,8 +5610,50 @@ static void bgp_aggregate_route(struct bgp *bgp, struct prefix *p,
        }
 }
 
-void bgp_aggregate_delete(struct bgp *, struct prefix *, afi_t, safi_t,
-                         struct bgp_aggregate *);
+static void bgp_aggregate_delete(struct bgp *bgp, struct prefix *p, afi_t afi,
+                                safi_t safi, struct bgp_aggregate *aggregate)
+{
+       struct bgp_table *table;
+       struct bgp_node *top;
+       struct bgp_node *rn;
+       struct bgp_info *ri;
+       unsigned long match;
+
+       table = bgp->rib[afi][safi];
+
+       /* If routes exists below this node, generate aggregate routes. */
+       top = bgp_node_get(table, p);
+       for (rn = bgp_node_get(table, p); rn;
+            rn = bgp_route_next_until(rn, top)) {
+               if (rn->p.prefixlen <= p->prefixlen)
+                       continue;
+               match = 0;
+
+               for (ri = rn->info; ri; ri = ri->next) {
+                       if (BGP_INFO_HOLDDOWN(ri))
+                               continue;
+
+                       if (ri->sub_type == BGP_ROUTE_AGGREGATE)
+                               continue;
+
+                       if (aggregate->summary_only && ri->extra) {
+                               ri->extra->suppress--;
+
+                               if (ri->extra->suppress == 0) {
+                                       bgp_info_set_flag(
+                                               rn, ri, BGP_INFO_ATTR_CHANGED);
+                                       match++;
+                               }
+                       }
+                       aggregate->count--;
+               }
+
+               /* If this node was suppressed, process the change. */
+               if (match)
+                       bgp_process(bgp, rn, afi, safi);
+       }
+       bgp_unlock_node(top);
+}
 
 void bgp_aggregate_increment(struct bgp *bgp, struct prefix *p,
                             struct bgp_info *ri, afi_t afi, safi_t safi)
@@ -5783,51 +5825,6 @@ static void bgp_aggregate_add(struct bgp *bgp, struct prefix *p, afi_t afi,
        }
 }
 
-void bgp_aggregate_delete(struct bgp *bgp, struct prefix *p, afi_t afi,
-                         safi_t safi, struct bgp_aggregate *aggregate)
-{
-       struct bgp_table *table;
-       struct bgp_node *top;
-       struct bgp_node *rn;
-       struct bgp_info *ri;
-       unsigned long match;
-
-       table = bgp->rib[afi][safi];
-
-       /* If routes exists below this node, generate aggregate routes. */
-       top = bgp_node_get(table, p);
-       for (rn = bgp_node_get(table, p); rn;
-            rn = bgp_route_next_until(rn, top)) {
-               if (rn->p.prefixlen <= p->prefixlen)
-                       continue;
-               match = 0;
-
-               for (ri = rn->info; ri; ri = ri->next) {
-                       if (BGP_INFO_HOLDDOWN(ri))
-                               continue;
-
-                       if (ri->sub_type == BGP_ROUTE_AGGREGATE)
-                               continue;
-
-                       if (aggregate->summary_only && ri->extra) {
-                               ri->extra->suppress--;
-
-                               if (ri->extra->suppress == 0) {
-                                       bgp_info_set_flag(
-                                               rn, ri, BGP_INFO_ATTR_CHANGED);
-                                       match++;
-                               }
-                       }
-                       aggregate->count--;
-               }
-
-               /* If this node was suppressed, process the change. */
-               if (match)
-                       bgp_process(bgp, rn, afi, safi);
-       }
-       bgp_unlock_node(top);
-}
-
 /* Aggregate route attribute. */
 #define AGGREGATE_SUMMARY_ONLY 1
 #define AGGREGATE_AS_SET       1