aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-06-18 16:05:54 +0000
committerNick Mathewson <nickm@torproject.org>2006-06-18 16:05:54 +0000
commitb5c599412f33a2e2a1643e4b0f0c05471b5ae7a1 (patch)
treef854ec0c33d6cda299207a1284137f2e7e02587c /src/or/routerlist.c
parenta9cffd2ff011c4480794c162d8a37267777e3fab (diff)
downloadtor-b5c599412f33a2e2a1643e4b0f0c05471b5ae7a1.tar
tor-b5c599412f33a2e2a1643e4b0f0c05471b5ae7a1.tar.gz
Backport candidate: implement the "is this uptime change cosmetic" test properly.
svn:r6654
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index db7c3846d..f5cd052c2 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3738,6 +3738,9 @@ router_reset_descriptor_download_failures(void)
* automatically non-cosmetic. */
#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)
+
/** 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.
*/
@@ -3797,7 +3800,8 @@ router_differences_are_cosmetic(routerinfo_t *r1, routerinfo_t *r2)
* give or take 30 minutes? */
r1pub = r1->cache_info.published_on;
r2pub = r2->cache_info.published_on;
- if (abs(r2->uptime - (r1->uptime + (r2pub - r1pub))))
+ if (abs(r2->uptime - (r1->uptime + (r2pub - r1pub)))
+ > ROUTER_ALLOW_UPTIME_DRIFT)
return 0;
/* Otherwise, the difference is cosmetic. */