[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/release-0.2.8] Allow directories in small networks to bootstrap



commit c2817774c28a40f76890b68775097596d14e035e
Author: teor (Tim Wilson-Brown) <teor2345@xxxxxxxxx>
Date:   Mon May 9 14:29:07 2016 -0400

    Allow directories in small networks to bootstrap
    
    Skip DirPort checks when the consensus has no exits.
    
    Resolves #19003, bugfix on #18050 in 0.2.8.1-alpha.
---
 changes/bug19003 | 5 +++++
 src/or/router.c  | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/changes/bug19003 b/changes/bug19003
new file mode 100644
index 0000000..d9ef23d
--- /dev/null
+++ b/changes/bug19003
@@ -0,0 +1,5 @@
+  o Minor bugfixes (small networks):
+    - Allow directories in small networks to bootstrap by
+      skipping DirPort checks when the consensus has no exits.
+      Resolves #19003, bugfix on #18050 in 0.2.8.1-alpha.
+      Patch by teor.
diff --git a/src/or/router.c b/src/or/router.c
index 68bcf13..dd84210 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1551,6 +1551,8 @@ proxy_mode(const or_options_t *options)
  * and
  * - We believe both our ORPort and DirPort (if present) are reachable from
  *   the outside; or
+ * - We believe both our ORPort is reachable from the outside, and we can't
+ *   check our DirPort because the consensus has no exits; or
  * - We are an authoritative directory server.
  */
 static int
@@ -1568,7 +1570,13 @@ decide_if_publishable_server(void)
     return 1;
   if (!router_get_advertised_or_port(options))
     return 0;
+  /* If there are no exits in the consensus, but have enough descriptors to
+   * build internal paths, we can't possibly verify our DirPort.
+   * This only happens in small networks without exits. */
+  if (router_have_consensus_path() == CONSENSUS_PATH_INTERNAL)
+    return check_whether_orport_reachable();
 
+  /* If there are exits in the consensus, use an exit to check our DirPort. */
   return check_whether_orport_reachable() && check_whether_dirport_reachable();
 }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits