summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2014-12-20 21:42:28 +1100
committerteor <teor2345@gmail.com>2014-12-24 06:13:32 +1100
commit083c58f126a4390b96b0e3f14d809502d8702f3d (patch)
tree1762da4043f2ad3e0d633b678f76c9139315bf71
parentf7e8bc2b4bc0d6072a337d9420cd5cd395c9f9d2 (diff)
downloadtor-083c58f126a4390b96b0e3f14d809502d8702f3d.tar.gz
tor-083c58f126a4390b96b0e3f14d809502d8702f3d.zip
Fix TestingMinExitFlagThreshold 0
Stop requiring exits to have non-zero bandwithcapacity in a TestingTorNetwork. Instead, when TestingMinExitFlagThreshold is 0, ignore exit bandwidthcapacity. This assists in bootstrapping a testing Tor network. Fixes bugs 13718 & 13839. Makes bug 13161's TestingDirAuthVoteExit non-essential.
-rw-r--r--changes/bug13839-fix-TestingMinExitFlagThreshold7
-rw-r--r--src/or/dirserv.c24
2 files changed, 26 insertions, 5 deletions
diff --git a/changes/bug13839-fix-TestingMinExitFlagThreshold b/changes/bug13839-fix-TestingMinExitFlagThreshold
new file mode 100644
index 0000000000..947614f550
--- /dev/null
+++ b/changes/bug13839-fix-TestingMinExitFlagThreshold
@@ -0,0 +1,7 @@
+ o Minor bugfixes:
+ - Stop requiring exits to have non-zero bandwithcapacity in a
+ TestingTorNetwork. Instead, when TestingMinExitFlagThreshold is 0,
+ ignore exit bandwidthcapacity.
+ This assists in bootstrapping a testing Tor network.
+ Fixes bugs 13718 & 13839.
+ Makes bug 13161's TestingDirAuthVoteExit non-essential.
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index d31bb72361..a1d22b041f 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -887,12 +887,26 @@ static int
router_is_active(const routerinfo_t *ri, const node_t *node, time_t now)
{
time_t cutoff = now - ROUTER_MAX_AGE_TO_PUBLISH;
- if (ri->cache_info.published_on < cutoff)
+ if (ri->cache_info.published_on < cutoff) {
return 0;
- if (!node->is_running || !node->is_valid || ri->is_hibernating)
+ }
+ if (!node->is_running || !node->is_valid || ri->is_hibernating) {
return 0;
- if (!ri->bandwidthcapacity)
+ }
+ /* Only require bandwith capacity in non-test networks, or
+ * if TestingTorNetwork, and TestingMinExitFlagThreshold is non-zero */
+ if (!ri->bandwidthcapacity) {
+ if (get_options()->TestingTorNetwork) {
+ if (get_options()->TestingMinExitFlagThreshold > 0) {
+ /* If we're in a TestingTorNetwork, and TestingMinExitFlagThreshold is,
+ * then require bandwidthcapacity */
+ return 0;
+ }
+ } else {
+ /* If we're not in a TestingTorNetwork, then require bandwidthcapacity */
return 0;
+ }
+ }
return 1;
}
@@ -1037,7 +1051,7 @@ directory_fetches_dir_info_later(const or_options_t *options)
}
/** Return true iff we want to fetch and keep certificates for authorities
- * that we don't acknowledge as aurthorities ourself.
+ * that we don't acknowledge as authorities ourself.
*/
int
directory_caches_unknown_auth_certs(const or_options_t *options)
@@ -1498,7 +1512,7 @@ dirserv_compute_performance_thresholds(routerlist_t *rl,
(unsigned long)guard_tk,
(unsigned long)guard_bandwidth_including_exits_kb,
(unsigned long)guard_bandwidth_excluding_exits_kb,
- enough_mtbf_info ? "" : " don't ");
+ enough_mtbf_info ? "" : " don't");
tor_free(uptimes);
tor_free(mtbfs);