]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add config option AuthDirPublishIPv6.
authorLinus Nordberg <linus@torproject.org>
Thu, 19 Jul 2012 21:23:22 +0000 (23:23 +0200)
committerNick Mathewson <nickm@torproject.org>
Thu, 19 Jul 2012 21:51:15 +0000 (17:51 -0400)
Test for config option AuthDirPublishIPv6 == 1 rather than for running
as a bridge authority when deciding whether to care or not about IPv6
OR ports in descriptors.

Implements enhancement #6406.

changes/enh6406 [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/enh6406 b/changes/enh6406
new file mode 100644 (file)
index 0000000..08349b2
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor features:
+
+    - Add new configure option AuthDirPublishIPv6.  Implements
+      enhancement #6406.
index 3cf257cb151f7c5631461298b479118a124da5d8..364bfdc2f4cc5b10022c0357bcf005cb9d123309 100644 (file)
@@ -1736,6 +1736,12 @@ DIRECTORY AUTHORITY SERVER OPTIONS
     ports.  When set to auto, Tor tries to find out if the authority
     relay has IPv6 connectivity or not. (Default: auto)
 
+**AuthDirPublishIPv6** **0**|**1**::
+
+    Authoritative directories only. When set to 0, Tor will not
+    include IPv6 OR ports in votes. When set to 1, Tor will vote for
+    IPv6 OR ports. (Default: 0).
+
 HIDDEN SERVICE OPTIONS
 ----------------------
 
index 87c9cc4bb7b831cf0e555072355231d10dd6dfac..1a378c2271b139636ab6ed02070fce591e0c95ea 100644 (file)
@@ -202,6 +202,7 @@ static config_var_t _option_vars[] = {
   V(AuthDirMaxServersPerAddr,    UINT,     "2"),
   V(AuthDirMaxServersPerAuthAddr,UINT,     "5"),
   V(AuthDirHasIPv6Connectivity,  AUTOBOOL, "auto"),
+  V(AuthDirPublishIPv6,          BOOL,     "0"),
   VAR("AuthoritativeDirectory",  BOOL, AuthoritativeDir,    "0"),
   V(AutomapHostsOnResolve,       BOOL,     "0"),
   V(AutomapHostsSuffixes,        CSV,      ".onion,.exit"),
index 7020d5b2a3cd1c4770634ba7af7bbd36e462198c..d12ed8a81163b29748f7821756120210720eaeee 100644 (file)
@@ -2468,14 +2468,13 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs,
   strlcpy(rs->nickname, ri->nickname, sizeof(rs->nickname));
   rs->or_port = ri->or_port;
   rs->dir_port = ri->dir_port;
-  if (authdir_mode_bridge(options) &&
+  if (options->AuthDirPublishIPv6 == 1 &&
       !tor_addr_is_null(&ri->ipv6_addr) &&
       (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 (or we know that we're not on IPv6) so copy it to the
-       routerstatus.  */
+    /* We're configured for publishing IPv6 OR ports. There's an IPv6
+       OR port and it's 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 9474c00fae77abeec9c7aa28be9907cc3c3b3435..b6cffd4bea6b58ef6e59b3de60c0bf91b8add3cf 100644 (file)
@@ -3274,6 +3274,7 @@ typedef struct {
                                      * number of servers per IP address shared
                                      * with an authority. */
   int AuthDirHasIPv6Connectivity; /**< Autoboolean: are we on IPv6?  */
+  int AuthDirPublishIPv6; /**< Boolean: should we list IPv6 OR ports? */
 
   /** If non-zero, always vote the Fast flag for any relay advertising
    * this amount of capacity or more. */