]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add configure option AuthDirHasIPv6Connectivity.
authorLinus Nordberg <linus@nordberg.se>
Mon, 28 May 2012 12:41:04 +0000 (14:41 +0200)
committerLinus Nordberg <linus@torproject.org>
Thu, 19 Jul 2012 16:21:22 +0000 (18:21 +0200)
Implements enhancement 5974.

changes/bug5974 [new file with mode: 0644]
doc/tor.1.txt
src/or/config.c
src/or/dirserv.c
src/or/or.h

diff --git a/changes/bug5974 b/changes/bug5974
new file mode 100644 (file)
index 0000000..c016be1
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor features:
+
+    - Add new configure option AuthDirHasIPv6Connectivity.  Implements
+      feature #5974.
index 78c34874c538bea8811ecf153b328096e74fdb0f..3cf257cb151f7c5631461298b479118a124da5d8 100644 (file)
@@ -1728,6 +1728,14 @@ DIRECTORY AUTHORITY SERVER OPTIONS
     votes on whether to accept relays as hidden service directories.
     (Default: 1)
 
+**AuthDirHasIPv6Connectivity** **0**|**1**|**auto**::
+
+    Authoritative directories only. When set to 0, OR ports with an
+    IPv6 address are being accepted without reachability testing.
+    When set to 1, IPv6 OR ports are being tested just like IPv4 OR
+    ports.  When set to auto, Tor tries to find out if the authority
+    relay has IPv6 connectivity or not. (Default: auto)
+
 HIDDEN SERVICE OPTIONS
 ----------------------
 
index bfa8c7fad87d78b82ab6306fd3e29851a61b2675..87c9cc4bb7b831cf0e555072355231d10dd6dfac 100644 (file)
@@ -201,6 +201,7 @@ static config_var_t _option_vars[] = {
   V(AuthDirListBadExits,         BOOL,     "0"),
   V(AuthDirMaxServersPerAddr,    UINT,     "2"),
   V(AuthDirMaxServersPerAuthAddr,UINT,     "5"),
+  V(AuthDirHasIPv6Connectivity,  AUTOBOOL, "auto"),
   VAR("AuthoritativeDirectory",  BOOL, AuthoritativeDir,    "0"),
   V(AutomapHostsOnResolve,       BOOL,     "0"),
   V(AutomapHostsSuffixes,        CSV,      ".onion,.exit"),
index 4d6f93d18005e50ae5789e3664ebe0e9e1b87896..6f16469540be03d0d4725934c67c6264185aa773 100644 (file)
@@ -2470,11 +2470,12 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs,
   rs->dir_port = ri->dir_port;
   if (authdir_mode_bridge(options) &&
       !tor_addr_is_null(&ri->ipv6_addr) &&
-      node->last_reachable6 >= now - REACHABLE_TIMEOUT) {
+      (options->AuthDirHasIPv6Connectivity == 0 ||
+       node->last_reachable6 >= now - REACHABLE_TIMEOUT)) {
     /* We're a bridge authority (we're not ready for IPv6 relays in
        the consensus quite yet).  There's an IPv6 OR port and it's
-       reachable so copy it to the routerstatus.  FIXME: If we're not
-       on IPv6, copy it regardless of reachability.  */
+       reachable (or we know that we're not on IPv6) so copy it to the
+       routerstatus.  */
     tor_addr_copy(&rs->ipv6_addr, &ri->ipv6_addr);
     rs->ipv6_orport = ri->ipv6_orport;
   }
index a8ef4d97c824a23d5de40fa5934bb38125223b4a..9474c00fae77abeec9c7aa28be9907cc3c3b3435 100644 (file)
@@ -3273,6 +3273,7 @@ typedef struct {
   int AuthDirMaxServersPerAuthAddr; /**< Do not permit more than this
                                      * number of servers per IP address shared
                                      * with an authority. */
+  int AuthDirHasIPv6Connectivity; /**< Autoboolean: are we on IPv6?  */
 
   /** If non-zero, always vote the Fast flag for any relay advertising
    * this amount of capacity or more. */