summaryrefslogtreecommitdiff
path: root/src/feature/dirauth/dirauth_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/feature/dirauth/dirauth_config.c')
-rw-r--r--src/feature/dirauth/dirauth_config.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/src/feature/dirauth/dirauth_config.c b/src/feature/dirauth/dirauth_config.c
index 821ea38acd..ccece9721d 100644
--- a/src/feature/dirauth/dirauth_config.c
+++ b/src/feature/dirauth/dirauth_config.c
@@ -118,39 +118,6 @@ options_validate_dirauth_mode(const or_options_t *old_options,
}
/**
- * Legacy validation/normalization function for the dirauth bandwidth options
- * in options. Uses old_options as the previous options.
- *
- * Returns 0 on success, returns -1 and sets *msg to a newly allocated string
- * on error.
- */
-int
-options_validate_dirauth_bandwidth(const or_options_t *old_options,
- or_options_t *options,
- char **msg)
-{
- (void)old_options;
-
- if (BUG(!options))
- return -1;
-
- if (BUG(!msg))
- return -1;
-
- if (!authdir_mode(options))
- return 0;
-
- if (config_ensure_bandwidth_cap(&options->AuthDirFastGuarantee,
- "AuthDirFastGuarantee", msg) < 0)
- return -1;
- if (config_ensure_bandwidth_cap(&options->AuthDirGuardBWGuarantee,
- "AuthDirGuardBWGuarantee", msg) < 0)
- return -1;
-
- return 0;
-}
-
-/**
* Legacy validation/normalization function for the dirauth schedule options
* in options. Uses old_options as the previous options.
*
@@ -441,6 +408,13 @@ dirauth_options_pre_normalize(void *arg, char **msg_out)
options->RecommendedServerVersions =
config_lines_dup(options->RecommendedVersions);
+ if (config_ensure_bandwidth_cap(&options->AuthDirFastGuarantee,
+ "AuthDirFastGuarantee", msg_out) < 0)
+ return -1;
+ if (config_ensure_bandwidth_cap(&options->AuthDirGuardBWGuarantee,
+ "AuthDirGuardBWGuarantee", msg_out) < 0)
+ return -1;
+
return 0;
}