summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-11-17 01:53:33 +0000
committerRoger Dingledine <arma@torproject.org>2007-11-17 01:53:33 +0000
commitd6f8ba25c92430cbc0ba9f14da4c7518e309eb0e (patch)
tree942c088a3e105db8fe772081ba5c06ab1eeac40f
parentd09439872d81046d6edee7a4fa03fc4b68db8ab3 (diff)
downloadtor-d6f8ba25c92430cbc0ba9f14da4c7518e309eb0e.tar.gz
tor-d6f8ba25c92430cbc0ba9f14da4c7518e309eb0e.zip
back out r12509 and fix a better bug instead:
When authorities detected more than two relays running on the same IP address, they were clearing all the status flags but forgetting to clear the "hsdir" flag. So clients were being told that a given relay was the right choice for a v2 hsdir lookup, yet they never had its descriptor because it was marked as 'not running' in the consensus. svn:r12515
-rw-r--r--ChangeLog8
-rw-r--r--src/or/dirserv.c5
-rw-r--r--src/or/routerlist.c2
3 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 6eb820ec50..c4f18ba8b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,8 +10,12 @@ Changes in version 0.2.0.12-alpha - 2007-11-??
newly picked entry guard. Reported by Mike Perry.
- Changing the ExitPolicyRejectPrivate setting should cause us to
rebuild the descriptor.
- - When picking v2 hidden service directories, don't pick ones that
- aren't listed as Running.
+ - When authorities detected more than two relays running on the same
+ IP address, they were clearing all the status flags but forgetting
+ to clear the "hsdir" flag. So clients were being told that a
+ given relay was the right choice for a v2 hsdir lookup, yet they
+ never had its descriptor because it was marked as 'not running'
+ in the consensus.
- If we're trying to fetch a bridge descriptor and there's no way
the bridge authority could help us (for example, we don't know
a digest, or there is no bridge authority), don't be so eager to
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 36f661a4ca..39263467d3 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2022,7 +2022,10 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key,
if (digestmap_get(omit_as_sybil, ri->cache_info.identity_digest)) {
rs->is_authority = rs->is_exit = rs->is_stable = rs->is_fast =
rs->is_running = rs->is_named = rs->is_valid = rs->is_v2_dir =
- rs->is_possible_guard = 0;
+ rs->is_hs_dir = rs->is_possible_guard = 0;
+ /* FFFF we might want some mechanism to check later on if we
+ * missed zeroing any flags: it's easy to add a new flag but
+ * forget to add it to this clause. */
}
if (!vote_on_reachability)
rs->is_running = 0;
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index eeb4909649..dce42b5731 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -4480,7 +4480,7 @@ hid_serv_get_responsible_directories(smartlist_t *responsible_dirs,
i = start;
do {
routerstatus_t *r = smartlist_get(c->routerstatus_list, i);
- if (r->is_hs_dir && r->is_running) {
+ if (r->is_hs_dir) {
smartlist_add(responsible_dirs, r);
if (++n_added == REND_NUMBER_OF_CONSECUTIVE_REPLICAS)
return 0;