From 8383a9bd2721dbd8fb1b657269a2cdc40b4226e1 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Thu, 14 Sep 2006 03:06:54 +0000 Subject: [bgpd] RIB statistics address space size shouldnt double count space 2006-09-14 Paul Jakma * 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/bgp_route.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bgpd/bgp_route.c') 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++; -- cgit v1.2.1