summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-09-14 03:06:54 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-09-14 03:06:54 +0000
commit8383a9bd2721dbd8fb1b657269a2cdc40b4226e1 (patch)
tree573d50347b4b45eabebbcc30263c4bb45a61bb2f /bgpd
parent9fde6624fc480995449d8243fe85602d89927eb6 (diff)
[bgpd] RIB statistics address space size shouldnt double count space
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.. ;)
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/ChangeLog7
-rw-r--r--bgpd/bgp_route.c11
2 files changed, 13 insertions, 5 deletions
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 393b00d4..e679f434 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,5 +1,12 @@
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
just removing refcounting of peer threads, which is mostly
senseless as they're references leading from struct peer,
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 5dde41de..7cf86438 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -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++;