]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Create TestingDirAuthVoteHSDir like TestingDirAuthVoteExit/Guard
authorteor <teor2345@gmail.com>
Sat, 10 Jan 2015 10:43:31 +0000 (21:43 +1100)
committerteor <teor2345@gmail.com>
Sat, 10 Jan 2015 11:34:28 +0000 (22:34 +1100)
TestingDirAuthVoteHSDir ensures that authorities vote the HSDir flag
for the listed relays regardless of uptime or ORPort connectivity.
Respects the value of VoteOnHidServDirectoriesV2.

Partial fix for bug 14067.

changes/bug14067-TestingDirAuthVoteHSDir [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/bug14067-TestingDirAuthVoteHSDir b/changes/bug14067-TestingDirAuthVoteHSDir
new file mode 100644 (file)
index 0000000..52d2bee
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor features (authorities, testing):
+    - Create TestingDirAuthVoteHSDir like TestingDirAuthVoteExit/Guard.
+      Ensures that authorities vote the HSDir flag for the listed
+      relays regardless of uptime or ORPort connectivity.
+      Respects the value of VoteOnHidServDirectoriesV2.
+      Partial fix for bug 14067. Patch by "teor".
index 9e86a67359f7b0b0b477e9d08a81d492d0893d15..7b214538b06a29194fe50113b16f92cb97b44360 100644 (file)
@@ -2245,6 +2245,15 @@ The following options are used for running a testing Tor network.
     In order for this option to have any effect, **TestingTorNetwork**
     has to be set.
 
+[[TestingDirAuthVoteHSDir]] **TestingDirAuthVoteHSDir** __node__,__node__,__...__::
+    A list of identity fingerprints and country codes and
+    address patterns of nodes to vote HSDir for regardless of their
+    uptime and ORPort connectivity. See the **ExcludeNodes** option for more
+    information on how to specify nodes.
+ +
+    In order for this option to have any effect, **TestingTorNetwork**
+    and **VoteOnHidServDirectoriesV2** both have to be set.
+
 [[TestingEnableConnBwEvent]] **TestingEnableConnBwEvent** **0**|**1**::
     If this option is set, then Tor controllers may register for CONN_BW
     events.  Changing this requires that **TestingTorNetwork** is set.
index 9a374847d7a148eed75a53b1374a80b782989633..a1347b9d7d3d058a82fb802bb0976776cf17851c 100644 (file)
@@ -448,6 +448,7 @@ static config_var_t option_vars_[] = {
   V(TestingCertMaxDownloadTries, UINT, "8"),
   V(TestingDirAuthVoteExit, ROUTERSET, NULL),
   V(TestingDirAuthVoteGuard, ROUTERSET, NULL),
+  V(TestingDirAuthVoteHSDir, ROUTERSET, NULL),
   VAR("___UsingTestNetworkDefaults", BOOL, UsingTestNetworkDefaults_, "0"),
 
   { NULL, CONFIG_TYPE_OBSOLETE, 0, NULL }
index d668749c5bf346d55b64105e0104fae22b7c29ee..8abe6cb7782d34d7931ede3e7ed30c1fff140ff4 100644 (file)
@@ -2113,9 +2113,10 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs,
     rs->ipv6_orport = ri->ipv6_orport;
   }
 
-  /* Iff we are in a testing network, use TestingDirAuthVoteExit to
-     give out Exit flags, and TestingDirAuthVoteGuard to
-     give out Guard flags. */
+  /* Iff we are in a testing network, use TestingDirAuthVoteExit,
+     TestingDirAuthVoteGuard, and TestingDirAuthVoteHSDir to
+     give out the Exit, Guard, and HSDir flags, respectively. 
+     But don't set the corresponding node flags. */
   if (options->TestingTorNetwork) {
     if (routerset_contains_routerstatus(options->TestingDirAuthVoteExit,
                                         rs, 0)) {
@@ -2123,9 +2124,15 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs,
     }
 
     if (routerset_contains_routerstatus(options->TestingDirAuthVoteGuard,
-                                      rs, 0)) {
+                                        rs, 0)) {
       rs->is_possible_guard = 1;
     }
+
+    if (routerset_contains_routerstatus(options->TestingDirAuthVoteHSDir,
+                                        rs, 0)) {
+      /* TestingDirAuthVoteHSDir respects VoteOnHidServDirectoriesV2 */
+      rs->is_hs_dir = vote_on_hsdirs;
+    }
   }
 }
 
index 58e2164665efaa6dbb0f4cd506142a2a06623e25..f3fee8fc73558732230812033eef9c9ebc521b35 100644 (file)
@@ -4105,6 +4105,11 @@ typedef struct {
    * regardless of uptime and bandwidth. */
   routerset_t *TestingDirAuthVoteGuard;
 
+  /** Relays in a testing network which should be voted HSDir
+   * regardless of uptime and ORPort connectivity.
+   * Respects VoteOnHidServDirectoriesV2. */
+  routerset_t *TestingDirAuthVoteHSDir;
+
   /** Enable CONN_BW events.  Only altered on testing networks. */
   int TestingEnableConnBwEvent;