summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-10-14 09:56:10 -0400
committerDavid Goulet <dgoulet@torproject.org>2021-10-19 09:36:14 -0400
commitdb297a177edc8aba9334d6b3b525604d9b0f87a2 (patch)
tree38b83a0d44bb5e82b32f7adcfa6e4e6b880b115b
parent2a4a0c9012b5f1ee7b3f00f1d39eb84daab7ca79 (diff)
downloadtor-db297a177edc8aba9334d6b3b525604d9b0f87a2.tar.gz
tor-db297a177edc8aba9334d6b3b525604d9b0f87a2.zip
hs: Improve warning for bad service version
Now that we don't have version 2, it gives us: [warn] HiddenServiceVersion must be between 3 and 3, not 2. This commit changes it to: [warn] HiddenServiceVersion must be 3, not 2. Part of #40476 Signed-off-by: David Goulet <dgoulet@torproject.org>
-rw-r--r--src/feature/hs/hs_config.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/feature/hs/hs_config.c b/src/feature/hs/hs_config.c
index 7ffc7ecb96..f8d71674de 100644
--- a/src/feature/hs/hs_config.c
+++ b/src/feature/hs/hs_config.c
@@ -179,8 +179,12 @@ static bool
check_value_oob(int i, const char *name, int low, int high)
{
if (i < low || i > high) {
- log_warn(LD_CONFIG, "%s must be between %d and %d, not %d.",
- name, low, high, i);
+ if (low == high) {
+ log_warn(LD_CONFIG, "%s must be %d, not %d.", name, low, i);
+ } else {
+ log_warn(LD_CONFIG, "%s must be between %d and %d, not %d.",
+ name, low, high, i);
+ }
return true;
}
return false;