diff options
author | paul <paul> | 2006-09-14 03:06:54 +0000 |
---|---|---|
committer | paul <paul> | 2006-09-14 03:06:54 +0000 |
commit | 4b62d77c0c605665473ac1de578f2b800a9cb200 (patch) | |
tree | 97824f1f4d49cbe05f3591ea0ef29f5509d904e9 /bgpd/bgp_route.c | |
parent | cfd72751ff624166c3dda42b5ec7c2405c4b91f1 (diff) | |
download | quagga-4b62d77c0c605665473ac1de578f2b800a9cb200.tar.bz2 quagga-4b62d77c0c605665473ac1de578f2b800a9cb200.tar.xz |
[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/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 11 |
1 files changed, 6 insertions, 5 deletions
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++; |