]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
back out r12509 and fix a better bug instead:
authorRoger Dingledine <arma@torproject.org>
Sat, 17 Nov 2007 01:53:33 +0000 (01:53 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 17 Nov 2007 01:53:33 +0000 (01:53 +0000)
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

ChangeLog
src/or/dirserv.c
src/or/routerlist.c

index 6eb820ec506828c0f3aadd5a83f1a22d45e036b4..c4f18ba8b0d7c21430dd7e9ad67520650ef53f97 100644 (file)
--- 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
index 36f661a4ca433513dd54ec8f02fcf4e273c22f27..39263467d32f7e888ce5dc103c6de311e2e5b941 100644 (file)
@@ -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;
index eeb49096492b31d8daa1f1e88ed657c96f4e01f8..dce42b57317f5ff82ecba82a511ea43d2fec75b8 100644 (file)
@@ -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;