aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-11-01 23:53:15 +0000
committerNick Mathewson <nickm@torproject.org>2006-11-01 23:53:15 +0000
commit0ad2fd1129db9b429ace9658bb79a1075a24662d (patch)
tree043be78784dd4d54ebba8ae78934598d17b3738c /src/or
parent5d7ca19b446d6c74501e23ba1d2c27f7202b1e99 (diff)
downloadtor-0ad2fd1129db9b429ace9658bb79a1075a24662d.tar.gz
tor-0ad2fd1129db9b429ace9658bb79a1075a24662d.zip
r9467@Kushana: nickm | 2006-11-01 18:51:16 -0500
Allow larger amounts of drift in uptime to be "cosmetic". svn:r8891
Diffstat (limited to 'src/or')
-rw-r--r--src/or/routerlist.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 0f7a382fc5..26247b6872 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -4048,7 +4048,7 @@ router_reset_descriptor_download_failures(void)
#define ROUTER_MAX_COSMETIC_TIME_DIFFERENCE (12*60*60)
/** We allow uptime to vary from how much it ought to be by this much. */
-#define ROUTER_ALLOW_UPTIME_DRIFT (30*60)
+#define ROUTER_ALLOW_UPTIME_DRIFT (6*60*60)
/** Return true iff the only differences between r1 and r2 are such that
* would not cause a recent (post 0.1.1.6) dirserver to republish.
@@ -4057,6 +4057,7 @@ int
router_differences_are_cosmetic(routerinfo_t *r1, routerinfo_t *r2)
{
time_t r1pub, r2pub;
+ int time_difference;
tor_assert(r1 && r2);
/* r1 should be the one that was published first. */
@@ -4107,11 +4108,13 @@ router_differences_are_cosmetic(routerinfo_t *r1, routerinfo_t *r2)
return 0;
/* Did uptime fail to increase by approximately the amount we would think,
- * give or take 30 minutes? */
+ * give or take 4 hours? */
r1pub = r1->cache_info.published_on;
r2pub = r2->cache_info.published_on;
- if (abs(r2->uptime - (r1->uptime + (r2pub - r1pub)))
- > ROUTER_ALLOW_UPTIME_DRIFT)
+ time_difference = abs(r2->uptime - (r1->uptime + (r2pub - r1pub)));
+ if (time_difference > ROUTER_ALLOW_UPTIME_DRIFT &&
+ time_difference > r1->uptime * .05 &&
+ time_difference > r2->uptime * .05)
return 0;
/* Otherwise, the difference is cosmetic. */