[or-cvs] r8891: Allow larger amounts of drift in uptime to be "cosmetic". (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Wed Nov 1 23:53:16 UTC 2006


Author: nickm
Date: 2006-11-01 18:53:15 -0500 (Wed, 01 Nov 2006)
New Revision: 8891

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/routerlist.c
Log:
 r9467 at Kushana:  nickm | 2006-11-01 18:51:16 -0500
 Allow larger amounts of drift in uptime to be "cosmetic".



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r9467] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2006-11-01 18:16:44 UTC (rev 8890)
+++ tor/trunk/ChangeLog	2006-11-01 23:53:15 UTC (rev 8891)
@@ -5,6 +5,10 @@
   o Minor bugfixes
     - Don't log spurious warnings when we see a circuit close reason we
       don't recognize; it's probably just from a newer version of Tor.
+    - Have directory authorities allow larger amounts of drift in uptime
+      without replacing the server descriptor: previously, a server that
+      restarted every 30 minutes could have 48 "interesting" descriptors per
+      day.
 
 Changes in version 0.1.2.3-alpha - 2006-10-29
   o Minor features:

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2006-11-01 18:16:44 UTC (rev 8890)
+++ tor/trunk/src/or/routerlist.c	2006-11-01 23:53:15 UTC (rev 8891)
@@ -4048,7 +4048,7 @@
 #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 @@
 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 @@
     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. */



More information about the tor-commits mailing list