summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorc <c@chroniko.jp>2020-06-01 13:02:21 +0000
committerc <c@chroniko.jp>2020-06-01 13:02:21 +0000
commit7640a95602020fb6355d5db1a3cd8bb1c5c2acb5 (patch)
tree227a5a594177ac36a6355ffbd684d2ddf6532713
parent5922087ea89659b7be71867af93f8e912204f928 (diff)
downloadtor-7640a95602020fb6355d5db1a3cd8bb1c5c2acb5.tar.gz
tor-7640a95602020fb6355d5db1a3cd8bb1c5c2acb5.zip
config: Add IPv4 Address config debug logging
Per ticket #32888 this should address logging "the Address torrc option", "and whether it is an IP address, or a DNS name"; or the detected "local hostname", "and whether it is an IP address, or a DNS name". Some of these details already seem to be logged, so just add what's missing.
-rw-r--r--src/app/config/resolve_addr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/app/config/resolve_addr.c b/src/app/config/resolve_addr.c
index b551615c02..52f4efc992 100644
--- a/src/app/config/resolve_addr.c
+++ b/src/app/config/resolve_addr.c
@@ -110,6 +110,8 @@ resolve_my_address(int warn_severity, const or_options_t *options,
if (address && *address) {
strlcpy(hostname, address, sizeof(hostname));
+ log_debug(LD_CONFIG, "Trying configured Address '%s' as local hostname",
+ hostname);
} else { /* then we need to guess our address */
explicit_ip = 0; /* it's implicit */
explicit_hostname = 0; /* it's implicit */
@@ -129,6 +131,8 @@ resolve_my_address(int warn_severity, const or_options_t *options,
if (tor_inet_aton(hostname, &in) == 0) {
/* then we have to resolve it */
+ log_debug(LD_CONFIG, "Local hostname '%s' is DNS address. "
+ "Trying to resolve to IP address.", hostname);
explicit_ip = 0;
if (tor_lookup_hostname(hostname, &addr)) { /* failed to resolve */
uint32_t interface_ip; /* host order */
@@ -180,6 +184,8 @@ resolve_my_address(int warn_severity, const or_options_t *options,
}
}
} else {
+ log_debug(LD_CONFIG, "Local hostname '%s' is already IP address, "
+ "skipping DNS resolution", hostname);
addr = ntohl(in.s_addr); /* set addr so that addr_string is not
* illformed */
}