aboutsummaryrefslogtreecommitdiff
path: root/src/or/geoip.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-01-10 17:48:32 +0000
committerNick Mathewson <nickm@torproject.org>2008-01-10 17:48:32 +0000
commit59fdab43cd21ccee2d8712111dc8ba81c7791150 (patch)
treee484ba577054f7b5a31625ce9191ff408f910af9 /src/or/geoip.c
parentc508fa5aec04b52b6dffa75de960fa5f579307bb (diff)
downloadtor-59fdab43cd21ccee2d8712111dc8ba81c7791150.tar
tor-59fdab43cd21ccee2d8712111dc8ba81c7791150.tar.gz
r17552@catbus: nickm | 2008-01-10 12:13:43 -0500
Make bridge geoip data get rounded up, not down. svn:r13092
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r--src/or/geoip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 07928affc..9ae1bb288 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -354,6 +354,8 @@ geoip_get_client_history(time_t now)
c_hist_t *ent;
/* Only report a country if it has a minimum number of IPs. */
if (c >= MIN_IPS_TO_NOTE_COUNTRY) {
+ /* Round up to the next multiple of IP_GRANULARITY */
+ c += IP_GRANULARITY-1;
c -= c % IP_GRANULARITY;
countrycode = geoip_get_country_name(i);
ent = tor_malloc(sizeof(c_hist_t));