aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-10-16 11:20:43 -0400
committerNick Mathewson <nickm@torproject.org>2013-10-16 11:20:43 -0400
commit17d368281ad374908fb019e29f3f012659be010c (patch)
treea34ee421c26c1003f93b7928817699cc622c1933 /src
parent1129362bd7208413d93f7f8e1b4317883a5c7910 (diff)
parentfab8fd2c18491440b37b71e140e23e6091bbbe32 (diff)
downloadtor-17d368281ad374908fb019e29f3f012659be010c.tar
tor-17d368281ad374908fb019e29f3f012659be010c.tar.gz
Merge remote-tracking branch 'linus/bug9206_option'
Diffstat (limited to 'src')
-rw-r--r--src/or/config.c1
-rw-r--r--src/or/dirserv.c6
-rw-r--r--src/or/or.h4
3 files changed, 11 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 89f9e9ba4..14e8f9ab3 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -458,6 +458,7 @@ static config_var_t option_vars_[] = {
V(TestingDescriptorMaxDownloadTries, UINT, "8"),
V(TestingMicrodescMaxDownloadTries, UINT, "8"),
V(TestingCertMaxDownloadTries, UINT, "8"),
+ V(TestingDirAuthVoteGuard, ROUTERSET, NULL),
VAR("___UsingTestNetworkDefaults", BOOL, UsingTestNetworkDefaults_, "0"),
{ NULL, CONFIG_TYPE_OBSOLETE, 0, NULL }
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 3243ac47c..d30a47436 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -26,6 +26,7 @@
#include "router.h"
#include "routerlist.h"
#include "routerparse.h"
+#include "routerset.h"
/**
* \file dirserv.c
@@ -2705,6 +2706,11 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs,
} else {
rs->is_possible_guard = 0;
}
+ if (options->TestingTorNetwork &&
+ routerset_contains_routerstatus(options->TestingDirAuthVoteGuard,
+ rs, 0)) {
+ rs->is_possible_guard = 1;
+ }
rs->is_bad_directory = listbaddirs && node->is_bad_directory;
rs->is_bad_exit = listbadexits && node->is_bad_exit;
diff --git a/src/or/or.h b/src/or/or.h
index adb4adf11..2f0f9eb6e 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -4065,6 +4065,10 @@ typedef struct {
/** Minimum value for the Fast flag threshold on testing networks. */
uint64_t TestingMinFastFlagThreshold;
+ /** Relays in a testing network which should be voted Guard
+ * regardless of uptime and bandwidth. */
+ routerset_t *TestingDirAuthVoteGuard;
+
/** If true, and we have GeoIP data, and we're a bridge, keep a per-country
* count of how many client addresses have contacted us so that we can help
* the bridge authority guess which countries have blocked access to us. */