]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
relay: Move log notice after suggested address lookup
authorDavid Goulet <dgoulet@torproject.org>
Mon, 22 Feb 2021 14:13:54 +0000 (09:13 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Mon, 22 Feb 2021 14:13:54 +0000 (09:13 -0500)
When trying to find our address to publish, we would log notice if we couldn't
find it from the cache but then we would look at the suggested cache (which
contains the address from the authorities) in which we might actually have the
address.

Thus that log notice was misplaced. Move it down after the suggested address
cache lookup.

Closes #40300

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40300 [new file with mode: 0644]
src/feature/relay/relay_find_addr.c

diff --git a/changes/ticket40300 b/changes/ticket40300
new file mode 100644 (file)
index 0000000..aef01b4
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (relay):
+    - Remove a spammy log notice that should not have been indicating the
+      operator that its IPv4/v6 was missing but it was not. Fixes bug 40300;
+      bugfix on 0.4.5.1-alpha.
+
index 39e1cc6a1933dab92f5b44a1e5a6095ce67314c9..2a3f602438e36fd74fab8efa6c73bfdf89c60c0b 100644 (file)
@@ -144,17 +144,6 @@ relay_find_addr_to_publish, (const or_options_t *options, int family,
     if (find_my_address(options, family, LOG_INFO, addr_out, NULL, NULL)) {
       goto found;
     }
-    /* No publishable address was found even though we have an ORPort thus
-     * print a notice log so operator can notice. We'll do that every hour so
-     * it is not too spammy but enough so operators address the issue. */
-    static ratelim_t rlim = RATELIM_INIT(3600);
-    log_fn_ratelim(&rlim, LOG_NOTICE, LD_CONFIG,
-                   "Unable to find %s address for ORPort %u. "
-                   "You might want to specify %sOnly to it or set an "
-                   "explicit address or set Address.",
-                   fmt_af_family(family),
-                   routerconf_find_or_port(options, family),
-                   fmt_af_family(family));
   }
 
   /* Third, consider address from our suggestion cache. */
@@ -163,7 +152,19 @@ relay_find_addr_to_publish, (const or_options_t *options, int family,
     goto found;
   }
 
-  /* No publishable address was found. */
+  /* No publishable address was found even though we have an ORPort thus
+   * print a notice log so operator can notice. We'll do that every hour so
+   * it is not too spammy but enough so operators address the issue. */
+  static ratelim_t rlim = RATELIM_INIT(3600);
+  log_fn_ratelim(&rlim, LOG_NOTICE, LD_CONFIG,
+                 "Unable to find %s address for ORPort %u. "
+                 "You might want to specify %sOnly to it or set an "
+                 "explicit address or set Address.",
+                 fmt_af_family(family),
+                 routerconf_find_or_port(options, family),
+                 fmt_af_family(family));
+
+  /* Not found. */
   return false;
 
  found: