summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-03-20 14:26:22 -0400
committerNick Mathewson <nickm@torproject.org>2013-03-20 14:26:22 -0400
commita87f22ef6499818c1ff32f30c66e2e18d1e80ddf (patch)
tree86d3dfcfb6aa8239f04efe778a9fc52944c1e0a4
parent63a42b38b1ea6c9f1899c6a600363a332d438597 (diff)
parent5c5198e713365fecf44741ae6f287c2ebdef18f6 (diff)
downloadtor-a87f22ef6499818c1ff32f30c66e2e18d1e80ddf.tar.gz
tor-a87f22ef6499818c1ff32f30c66e2e18d1e80ddf.zip
Merge remote-tracking branch 'origin/maint-0.2.4'
-rw-r--r--changes/bug84084
-rw-r--r--doc/tor.1.txt5
-rw-r--r--src/or/circuituse.c1
-rw-r--r--src/or/config.c2
-rw-r--r--src/or/dirserv.c13
-rw-r--r--src/or/or.h6
6 files changed, 29 insertions, 2 deletions
diff --git a/changes/bug8408 b/changes/bug8408
new file mode 100644
index 0000000000..ae9cf172e1
--- /dev/null
+++ b/changes/bug8408
@@ -0,0 +1,4 @@
+ o Minor bugfixes:
+ - Allow TestingTorNetworks to override the 4096-byte minimum for the Fast
+ threshold. Otherwise they can't bootstrap until they've observed more
+ traffic. Fixes bug 8508; bugfix on 0.2.4.10-alpha.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 3be90be870..5727ec30fc 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -2019,6 +2019,11 @@ The following options are used for running a testing Tor network.
time. Changing this requires that **TestingTorNetwork** is set. (Default:
10 minutes)
+**TestingMinFastFlagThreshold** __N__ **bytes**|**KBytes**|**MBytes**|**GBytes**::
+ Minimum value for the Fast flag. Overrides the ordinary minimum taken
+ from the consensus when TestingTorNetwork is set. (Default: 0.)
+
+
SIGNALS
-------
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index d48449fa81..f02597e630 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -2312,3 +2312,4 @@ mark_circuit_unusable_for_new_conns(origin_circuit_t *circ)
circ->unusable_for_new_conns = 1;
}
+
diff --git a/src/or/config.c b/src/or/config.c
index f03f3802fc..75805d0ce8 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -341,6 +341,8 @@ static config_var_t option_vars_[] = {
V(PerConnBWRate, MEMUNIT, "0"),
V(PidFile, STRING, NULL),
V(TestingTorNetwork, BOOL, "0"),
+ V(TestingMinExitFlagThreshold, MEMUNIT, "0"),
+ V(TestingMinFastFlagThreshold, MEMUNIT, "0"),
V(OptimisticData, AUTOBOOL, "auto"),
V(PortForwarding, BOOL, "0"),
V(PortForwardingHelper, FILENAME, "tor-fw-helper"),
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 8e8f79a171..e837e4bed5 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1894,11 +1894,17 @@ router_counts_toward_thresholds(const node_t *node, time_t now,
/* Have measured bw? */
int have_mbw =
dirserv_has_measured_bw(node->ri->cache_info.identity_digest);
+ uint64_t min_bw = ABSOLUTE_MIN_BW_VALUE_TO_CONSIDER;
+ const or_options_t *options = get_options();
+
+ if (options->TestingTorNetwork) {
+ min_bw = (int64_t)options->TestingMinExitFlagThreshold;
+ }
return node->ri && router_is_active(node->ri, node, now) &&
!digestmap_get(omit_as_sybil, node->ri->cache_info.identity_digest) &&
- (dirserv_get_credible_bandwidth(node->ri) >=
- ABSOLUTE_MIN_BW_VALUE_TO_CONSIDER) && (have_mbw || !require_mbw);
+ (dirserv_get_credible_bandwidth(node->ri) >= min_bw) &&
+ (have_mbw || !require_mbw);
}
/** Look through the routerlist, the Mean Time Between Failure history, and
@@ -2005,6 +2011,9 @@ dirserv_compute_performance_thresholds(routerlist_t *rl,
ABSOLUTE_MIN_VALUE_FOR_FAST_FLAG,
ABSOLUTE_MIN_VALUE_FOR_FAST_FLAG,
INT32_MAX);
+ if (options->TestingTorNetwork) {
+ min_fast = (int32_t)options->TestingMinFastFlagThreshold;
+ }
max_fast = networkstatus_get_param(NULL, "FastFlagMaxThreshold",
INT32_MAX, min_fast, INT32_MAX);
if (fast_bandwidth < (uint32_t)min_fast)
diff --git a/src/or/or.h b/src/or/or.h
index 88fd38d9d7..4d52710872 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3912,6 +3912,12 @@ typedef struct {
* of certain configuration options. */
int TestingTorNetwork;
+ /** Minimum value for the Exit flag threshold on testing networks. */
+ uint64_t TestingMinExitFlagThreshold;
+
+ /** Minimum value for the Fast flag threshold on testing networks. */
+ uint64_t TestingMinFastFlagThreshold;
+
/** 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. */