]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
relay: Emit log warning if Address is internal and can't be used
authorDavid Goulet <dgoulet@torproject.org>
Thu, 25 Mar 2021 14:15:50 +0000 (10:15 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 19 Apr 2021 15:40:30 +0000 (11:40 -0400)
Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40290 [new file with mode: 0644]
src/app/config/resolve_addr.c

diff --git a/changes/ticket40290 b/changes/ticket40290
new file mode 100644 (file)
index 0000000..3d3a64b
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfix (logging, relay):
+    - Emit a warning if an Address is found to be internal and tor can't use it.
+      Fixes bug 40290; bugfix on 0.4.5.1-alpha.
index 43a3eb39de3f631073ba95bc806b1674cec97759..09d4b800f66753751216ad4bc044e3c74dc38e67 100644 (file)
@@ -343,6 +343,18 @@ get_address_from_config(const or_options_t *options, int warn_severity,
      * used, custom authorities must be defined else it is a fatal error.
      * Furthermore, if the Address was resolved to an internal interface, we
      * stop immediately. */
+    if (ret == ERR_ADDRESS_IS_INTERNAL) {
+      static bool logged_once = false;
+      if (!logged_once) {
+        log_warn(LD_CONFIG, "Address set with an internal address. Tor will "
+                            "not work unless custom directory authorities "
+                            "are defined (AlternateDirAuthority). It is also "
+                            "possible to use an internal address if "
+                            "PublishServerDescriptor is set to 0 and "
+                            "AssumeReachable(IPv6) to 1.");
+        logged_once = true;
+      }
+    }
     tor_free(*hostname_out);
     return FN_RET_BAIL;
   }