]> git.proxmox.com Git - mirror_frr.git/commitdiff
[bgpd] RIB statistics address space size shouldnt double count space
authorPaul Jakma <paul.jakma@sun.com>
Thu, 14 Sep 2006 03:06:54 +0000 (03:06 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Thu, 14 Sep 2006 03:06:54 +0000 (03:06 +0000)
2006-09-14 Paul Jakma <paul.jakma@sun.com>

* bgp_route.c: (bgp_table_stats_walker) Address space announced
  should only count top-level unaggregateable prefixes, to
  avoid falling afoul of anti-dodgy-accounting regulations
  in various jurisdictions.. ;)

bgpd/ChangeLog
bgpd/bgp_route.c

index 393b00d4e965c5fd384e92a2a6b319173b4adcaf..e679f434068134c229e0e68f5f5fbfa065daa47e 100644 (file)
@@ -1,3 +1,10 @@
+2006-09-14 Paul Jakma <paul.jakma@sun.com>
+
+       * bgp_route.c: (bgp_table_stats_walker) Address space announced
+         should only count top-level unaggregateable prefixes, to
+         avoid falling afoul of anti-dodgy-accounting regulations
+         in various jurisdictions.. ;)
+
 2006-09-14 Paul Jakma <paul.jakma@sun.com>
 
        * (general) fix the peer refcount issue exposed by previous, by
index 5dde41de7a0258e032907905e12376375fbe114a..7cf86438c523f55753aefe20c437cd0fe5061001 100644 (file)
@@ -8522,14 +8522,15 @@ bgp_table_stats_walker (struct thread *t)
         prn = prn->parent;
       
       if (prn == NULL || prn == top)
-        ts->counts[BGP_STATS_UNAGGREGATEABLE]++;
+        {
+          ts->counts[BGP_STATS_UNAGGREGATEABLE]++;
+          /* announced address space */
+          if (space)
+            ts->counts[BGP_STATS_SPACE] += 1 << (space - rn->p.prefixlen);
+        }
       else if (prn->info)
         ts->counts[BGP_STATS_MAX_AGGREGATEABLE]++;
       
-      /* announced address space */
-      if (space)
-        ts->counts[BGP_STATS_SPACE] += 1 << (space - rn->p.prefixlen);
-      
       for (ri = rn->info; ri; ri = ri->next)
         {
           rinum++;