summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2013-02-12 17:18:51 -0500
committerRoger Dingledine <arma@torproject.org>2013-02-14 17:02:22 -0500
commit5d400b5f7f604e62265a74dd9d3442780cfe1f0f (patch)
treefdec0912fad7e2e3c9d50f395b5723a0f84a0c90
parent41e0f7146a0377fb67858433deb4d9f4d7e95327 (diff)
downloadtor-5d400b5f7f604e62265a74dd9d3442780cfe1f0f.tar.gz
tor-5d400b5f7f604e62265a74dd9d3442780cfe1f0f.zip
Authorities were adding downtime for every relay every restart
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.
-rw-r--r--changes/bug82186
-rw-r--r--src/or/rephist.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/changes/bug8218 b/changes/bug8218
new file mode 100644
index 0000000000..ce8d53ba62
--- /dev/null
+++ b/changes/bug8218
@@ -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.
+
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 1bee6459cc..55f321d5ff 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -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);