aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-05-28 16:13:06 -0400
committerNick Mathewson <nickm@torproject.org>2013-05-28 16:13:06 -0400
commit97d1caadfdf63043e23c7c3fd45465859e1340e2 (patch)
tree59955dbd4785bab42b41065123a4376f593c6200 /src/or
parentd3125a3e404f4967d9100d793b01dcbed6eeadc2 (diff)
downloadtor-97d1caadfdf63043e23c7c3fd45465859e1340e2.tar
tor-97d1caadfdf63043e23c7c3fd45465859e1340e2.tar.gz
Start correctly when not in testing mode.
You can't use != to compare arbitary members of or_options_t. (Also, generate a better error message to say which Testing* option was set.) Fix for bug 8992. Bugfix on b0d4ca49. Bug not in any released Tor.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/config.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 8734763af..2cdf5b207 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -3212,13 +3212,15 @@ options_validate(or_options_t *old_options, or_options_t *options,
"ignore you.");
}
-#define CHECK_DEFAULT(arg) \
- STMT_BEGIN if (default_options->arg != options->arg && \
- !options->TestingTorNetwork && \
- !options->UsingTestNetworkDefaults_) { \
- REJECT("Testing* options may only be changed in testing Tor " \
- "networks!"); \
- } STMT_END
+#define CHECK_DEFAULT(arg) \
+ STMT_BEGIN \
+ if (!options->TestingTorNetwork && \
+ !options->UsingTestNetworkDefaults_ && \
+ !config_is_same(&options_format,options, \
+ default_options,#arg)) { \
+ REJECT(#arg " may only be changed in testing Tor " \
+ "networks!"); \
+ } STMT_END
CHECK_DEFAULT(TestingV3AuthInitialVotingInterval);
CHECK_DEFAULT(TestingV3AuthInitialVoteDelay);
CHECK_DEFAULT(TestingV3AuthInitialDistDelay);