]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hs: Improve warning for bad service version
authorDavid Goulet <dgoulet@torproject.org>
Thu, 14 Oct 2021 13:56:10 +0000 (09:56 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 19 Oct 2021 13:50:23 +0000 (09:50 -0400)
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>
src/feature/hs/hs_config.c

index 7ffc7ecb96579cc7a149c2e4bfa3ca6bcb18c666..f8d71674ded1dbad06ee3dc17de9ff606fd325e5 100644 (file)
@@ -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;