summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-10-29 17:57:04 +1000
committerteor <teor@torproject.org>2019-10-31 12:34:20 +1000
commit0a511778eb6f3ca00d0e3da99327cce2cf179830 (patch)
treef2cc7d1827a65f0b27b29b55bdcc938feb3328a0 /src/app
parentd5ca56e2543fb988de34b10d1d868c2c2e96cd51 (diff)
downloadtor-0a511778eb6f3ca00d0e3da99327cce2cf179830.tar.gz
tor-0a511778eb6f3ca00d0e3da99327cce2cf179830.zip
config: Move bw & other configs into the dirauth module
This commit: * moves bandwidth checks into dirauth_config, and * moves some other minor checks into dirauth_config. The moved code is disabled when the dirauth module is disabled. (And some of the checks are re-ordered, so the order of some warnings may change.) Part of 32213.
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config/config.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index b9a15a6826..7c31a44433 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -3418,13 +3418,6 @@ options_validate_cb(const void *old_options_, void *options_, char **msg)
if (options_init_logs(old_options, options, 1)<0)
REJECT("Failed to validate Log options. See logs for details.");
- if (authdir_mode(options)) {
- /* confirm that our address isn't broken, so we can complain now */
- uint32_t tmp;
- if (resolve_my_address(LOG_WARN, options, &tmp, NULL, NULL) < 0)
- REJECT("Failed to resolve/guess local address. See logs for details.");
- }
-
/* XXXX require that the only port not be DirPort? */
/* XXXX require that at least one port be listened-upon. */
if (n_ports == 0 && !options->RendConfigLines)
@@ -3649,12 +3642,6 @@ options_validate_cb(const void *old_options_, void *options_, char **msg)
if (options_validate_relay_padding(old_options, options, msg) < 0)
return -1;
- if (options->MinUptimeHidServDirectoryV2 < 0) {
- log_warn(LD_CONFIG, "MinUptimeHidServDirectoryV2 option must be at "
- "least 0 seconds. Changing to 0.");
- options->MinUptimeHidServDirectoryV2 = 0;
- }
-
const int min_rendpostperiod =
options->TestingTorNetwork ?
MIN_REND_POST_PERIOD_TESTING : MIN_REND_POST_PERIOD;
@@ -3833,16 +3820,11 @@ options_validate_cb(const void *old_options_, void *options_, char **msg)
if (ensure_bandwidth_cap(&options->BandwidthBurst,
"BandwidthBurst", msg) < 0)
return -1;
- if (ensure_bandwidth_cap(&options->AuthDirFastGuarantee,
- "AuthDirFastGuarantee", msg) < 0)
- return -1;
- if (ensure_bandwidth_cap(&options->AuthDirGuardBWGuarantee,
- "AuthDirGuardBWGuarantee", msg) < 0)
- return -1;
-
if (options_validate_relay_bandwidth(old_options, options, msg) < 0)
return -1;
+ if (options_validate_dirauth_bandwidth(old_options, options, msg) < 0)
+ return -1;
if (options->BandwidthRate > options->BandwidthBurst)
REJECT("BandwidthBurst must be at least equal to BandwidthRate.");