[or-cvs] [tor/master] No dirport should mean no hsdir flag (bug 1693)

arma at torproject.org arma at torproject.org
Wed Jul 14 17:22:21 UTC 2010


Author: Roger Dingledine <arma at torproject.org>
Date: Wed, 14 Jul 2010 13:20:57 -0400
Subject: No dirport should mean no hsdir flag (bug 1693)
Commit: c6f579240438f5085418ebb9f1865b789b25eb61

---
 changes/1693-withhold-hsdir-if-no-dirport |    8 ++++++++
 src/or/dirserv.c                          |    8 ++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 changes/1693-withhold-hsdir-if-no-dirport

diff --git a/changes/1693-withhold-hsdir-if-no-dirport b/changes/1693-withhold-hsdir-if-no-dirport
new file mode 100644
index 0000000..23027ff
--- /dev/null
+++ b/changes/1693-withhold-hsdir-if-no-dirport
@@ -0,0 +1,8 @@
+  o Major bugfixes:
+    - Stop assigning the HSDir flag to relays that disable their
+      DirPort (and thus will refuse to answer directory requests). This
+      fix should dramatically improve the reachability of hidden services:
+      hidden services and hidden service clients pick three HSDir relays
+      to store and retrieve the hidden service descriptor, and currently
+      about half of the HSDir relays will refuse to work. Bugfix on
+      0.2.0.10-alpha; fixes part of bug 1693.
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 24b4d54..9eff6af 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1717,7 +1717,7 @@ dirserv_thinks_router_is_unreliable(time_t now,
 
 /** Return true iff <b>router</b> should be assigned the "HSDir" flag.
  * Right now this means it advertises support for it, it has a high
- * uptime, and it's currently considered Running.
+ * uptime, it has a DirPort open, and it's currently considered Running.
  *
  * This function needs to be called after router-\>is_running has
  * been set.
@@ -1727,7 +1727,11 @@ dirserv_thinks_router_is_hs_dir(routerinfo_t *router, time_t now)
 {
   long uptime = real_uptime(router, now);
 
-  return (router->wants_to_be_hs_dir &&
+  /* XXX We shouldn't need to check dir_port, but we do because of
+   * bug 1693. In the future, once relays set wants_to_be_hs_dir
+   * correctly, we can revert to only checking dir_port if router's
+   * version is too old. */
+  return (router->wants_to_be_hs_dir && router->dir_port &&
           uptime > get_options()->MinUptimeHidServDirectoryV2 &&
           router->is_running);
 }
-- 
1.7.1



More information about the tor-commits mailing list