From 359faf5e4b4a88663201c2b42dd89a6f77569856 Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 6 May 2015 23:40:23 +1000 Subject: New TestingDirAuthVote{Exit,Guard,HSDir}IsStrict flags "option to prevent guard,exit,hsdir flag assignment" "A node will never receive the corresponding flag unless that node is specified in the TestingDirAuthVote{Exit,Guard,HSDir} list, regardless of its uptime, bandwidth, exit policy, or DirPort". Patch modified by "teor": VoteOnHidServDirectoriesV2 is now obsolete, so TestingDirAuthVoteHSDir always votes on HSDirs. Closes ticket 14882. Patch by "robgjansen". Commit message and changes file by "teor" with quotes from "robgjansen". --- src/or/config.c | 3 +++ src/or/dirserv.c | 6 ++++++ src/or/or.h | 3 +++ 3 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/or/config.c b/src/or/config.c index 618c941fb4..c991bbc84f 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -479,8 +479,11 @@ static config_var_t option_vars_[] = { V(TestingMicrodescMaxDownloadTries, UINT, "8"), V(TestingCertMaxDownloadTries, UINT, "8"), V(TestingDirAuthVoteExit, ROUTERSET, NULL), + V(TestingDirAuthVoteExitIsStrict, BOOL, "0"), V(TestingDirAuthVoteGuard, ROUTERSET, NULL), + V(TestingDirAuthVoteGuardIsStrict, BOOL, "0"), V(TestingDirAuthVoteHSDir, ROUTERSET, NULL), + V(TestingDirAuthVoteHSDirIsStrict, BOOL, "0"), VAR("___UsingTestNetworkDefaults", BOOL, UsingTestNetworkDefaults_, "0"), { NULL, CONFIG_TYPE_OBSOLETE, 0, NULL } diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 8eeba54374..f81d56ae10 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2195,16 +2195,22 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs, if (routerset_contains_routerstatus(options->TestingDirAuthVoteExit, rs, 0)) { rs->is_exit = 1; + } else if (options->TestingDirAuthVoteExitIsStrict) { + rs->is_exit = 0; } if (routerset_contains_routerstatus(options->TestingDirAuthVoteGuard, rs, 0)) { rs->is_possible_guard = 1; + } else if (options->TestingDirAuthVoteGuardIsStrict) { + rs->is_possible_guard = 0; } if (routerset_contains_routerstatus(options->TestingDirAuthVoteHSDir, rs, 0)) { rs->is_hs_dir = 1; + } else if (options->TestingDirAuthVoteHSDirIsStrict) { + rs->is_hs_dir = 0; } } } diff --git a/src/or/or.h b/src/or/or.h index 4a313515f4..cf9f2b1414 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -4094,15 +4094,18 @@ typedef struct { /** Relays in a testing network which should be voted Exit * regardless of exit policy. */ routerset_t *TestingDirAuthVoteExit; + int TestingDirAuthVoteExitIsStrict; /** Relays in a testing network which should be voted Guard * regardless of uptime and bandwidth. */ routerset_t *TestingDirAuthVoteGuard; + int TestingDirAuthVoteGuardIsStrict; /** Relays in a testing network which should be voted HSDir * regardless of uptime and DirPort. * Respects VoteOnHidServDirectoriesV2. */ routerset_t *TestingDirAuthVoteHSDir; + int TestingDirAuthVoteHSDirIsStrict; /** Enable CONN_BW events. Only altered on testing networks. */ int TestingEnableConnBwEvent; -- cgit v1.2.3-54-g00ecf