[or-cvs] r12515: back out r12509 and fix a better bug instead: When authoriti (in tor/trunk: . src/or)

arma at seul.org arma at seul.org
Sat Nov 17 01:53:33 UTC 2007


Author: arma
Date: 2007-11-16 20:53:33 -0500 (Fri, 16 Nov 2007)
New Revision: 12515

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/dirserv.c
   tor/trunk/src/or/routerlist.c
Log:
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.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-11-16 07:37:49 UTC (rev 12514)
+++ tor/trunk/ChangeLog	2007-11-17 01:53:33 UTC (rev 12515)
@@ -10,8 +10,12 @@
       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

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2007-11-16 07:37:49 UTC (rev 12514)
+++ tor/trunk/src/or/dirserv.c	2007-11-17 01:53:33 UTC (rev 12515)
@@ -2022,7 +2022,10 @@
       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;

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-11-16 07:37:49 UTC (rev 12514)
+++ tor/trunk/src/or/routerlist.c	2007-11-17 01:53:33 UTC (rev 12515)
@@ -4480,7 +4480,7 @@
   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;



More information about the tor-commits mailing list