]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Authorities were adding downtime for every relay every restart
authorRoger Dingledine <arma@torproject.org>
Tue, 12 Feb 2013 22:18:51 +0000 (17:18 -0500)
committerRoger Dingledine <arma@torproject.org>
Thu, 14 Feb 2013 22:02:22 +0000 (17:02 -0500)
Stop marking every relay as having been down for one hour every
time we restart a directory authority. These artificial downtimes
were messing with our Stable and Guard flag calculations.

Fixes bug 8218 (introduced by the fix for 1035). Bugfix on 0.2.2.23-alpha.

changes/bug8218 [new file with mode: 0644]
src/or/rephist.c

diff --git a/changes/bug8218 b/changes/bug8218
new file mode 100644 (file)
index 0000000..ce8d53b
--- /dev/null
@@ -0,0 +1,6 @@
+  o Major bugfixes:
+    - Stop marking every relay as having been down for one hour every
+      time we restart a directory authority. These artificial downtimes
+      were messing with our Stable and Guard flag calculations. Fixes
+      bug 8218 (introduced by the fix for 1035). Bugfix on 0.2.2.23-alpha.
+
index 1bee6459cccac8961688cdf7b934bb4b8d1cf36e..55f321d5ff89bbe66179da2872b4e60804b4d41a 100644 (file)
@@ -310,9 +310,10 @@ rep_hist_note_router_reachable(const char *id, const tor_addr_t *at_addr,
   tor_assert(hist);
   tor_assert((!at_addr && !at_port) || (at_addr && at_port));
 
-  addr_changed = at_addr &&
+  addr_changed = at_addr && !tor_addr_is_null(&hist->last_reached_addr) &&
     tor_addr_compare(at_addr, &hist->last_reached_addr, CMP_EXACT) != 0;
-  port_changed = at_port && at_port != hist->last_reached_port;
+  port_changed = at_port && hist->last_reached_port &&
+                 at_port != hist->last_reached_port;
 
   if (!started_tracking_stability)
     started_tracking_stability = time(NULL);