summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-12-17 22:39:10 +0000
committerRoger Dingledine <arma@torproject.org>2008-12-17 22:39:10 +0000
commitbc5e4cd39e02fbd04a1ab9dfe78928930beb6512 (patch)
tree752c3ffec9f8b0324681b1825d45707a21b4dd91
parent0d4abea19387e0255a6c8592c7aee2e3b7819567 (diff)
downloadtor-bc5e4cd39e02fbd04a1ab9dfe78928930beb6512.tar.gz
tor-bc5e4cd39e02fbd04a1ab9dfe78928930beb6512.zip
backport r17657
svn:r17658
-rw-r--r--ChangeLog6
-rw-r--r--src/or/config.c21
2 files changed, 27 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d8e104342..93741fb436 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,12 @@ Changes in version 0.2.0.33 - 200?-??-??
- Fix another case of assuming, when a specific exit is requested,
that we know more than the user about what hosts it allows.
Fixes one case of bug 752. Patch from rovv.
+ - Clip the MaxCircuitDirtiness config option to a minimum of 10
+ seconds. Warn the user if lower values are given in the
+ configuration. Bugfix on 0.1.0.1-rc. Patch by Sebastian.
+ - Clip the CircuitBuildTimeout to a minimum of 30 seconds. Warn the
+ user if lower values are given in the configuration. Bugfix on
+ 0.1.1.17-rc. Patch by Sebastian.
o Minor features:
- Report the case where all signatures in a detached set are rejected
diff --git a/src/or/config.c b/src/or/config.c
index d69254b30d..3e6cac869d 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2681,6 +2681,15 @@ compute_publishserverdescriptor(or_options_t *options)
/** Highest allowable value for RendPostPeriod. */
#define MAX_DIR_PERIOD (MIN_ONION_KEY_LIFETIME/2)
+/** Lowest allowable value for CircuitBuildTimeout; values too low will
+ * increase network load because of failing connections being retried, and
+ * might prevent users from connecting to the network at all. */
+#define MIN_CIRCUIT_BUILD_TIMEOUT 30
+
+/** Lowest allowable value for MaxCircuitDirtiness; if this is too low, Tor
+ * will generate too many circuits and potentially overload the network. */
+#define MIN_MAX_CIRCUIT_DIRTINESS 10
+
/** Return 0 if every setting in <b>options</b> is reasonable, and a
* permissible transition from <b>old_options</b>. Else return -1.
* Should have no side effects, except for normalizing the contents of
@@ -3084,6 +3093,18 @@ options_validate(or_options_t *old_options, or_options_t *options,
options->RendPostPeriod = MAX_DIR_PERIOD;
}
+ if (options->CircuitBuildTimeout < MIN_CIRCUIT_BUILD_TIMEOUT) {
+ log(LOG_WARN, LD_CONFIG, "CircuitBuildTimeout option is too short; "
+ "raising to %d seconds.", MIN_CIRCUIT_BUILD_TIMEOUT);
+ options->CircuitBuildTimeout = MIN_CIRCUIT_BUILD_TIMEOUT;
+ }
+
+ if (options->MaxCircuitDirtiness < MIN_MAX_CIRCUIT_DIRTINESS) {
+ log(LOG_WARN, LD_CONFIG, "MaxCircuitDirtiness option is too short; "
+ "raising to %d seconds.", MIN_MAX_CIRCUIT_DIRTINESS);
+ options->MaxCircuitDirtiness = MIN_MAX_CIRCUIT_DIRTINESS;
+ }
+
if (options->KeepalivePeriod < 1)
REJECT("KeepalivePeriod option must be positive.");