Pārlūkot izejas kodu

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

Roger Dingledine 17 gadi atpakaļ
vecāks
revīzija
d6f8ba25c9
3 mainītis faili ar 11 papildinājumiem un 4 dzēšanām
  1. 6 2
      ChangeLog
  2. 4 1
      src/or/dirserv.c
  3. 1 1
      src/or/routerlist.c

+ 6 - 2
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

+ 4 - 1
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;

+ 1 - 1
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;