summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorc <c@chroniko.jp>2020-06-03 14:42:53 +0000
committerc <c@chroniko.jp>2020-06-03 14:42:53 +0000
commit1934e399afecea0859b7ea6b205be96d0f73380b (patch)
tree8a55ce612dc1df0374960ea9fc8d1dccd81a8530
parent7640a95602020fb6355d5db1a3cd8bb1c5c2acb5 (diff)
downloadtor-1934e399afecea0859b7ea6b205be96d0f73380b.tar.gz
tor-1934e399afecea0859b7ea6b205be96d0f73380b.zip
config: Add interface address debug logging
Add logging for "the local network interface addresses" as requested by ticket #32888.
-rw-r--r--src/lib/net/address.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index b8f5f37747..0571f48a30 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -1693,12 +1693,20 @@ get_interface_address6,(int severity, sa_family_t family, tor_addr_t *addr))
/* Find the first non-internal address, or the last internal address
* Ideally, we want the default route, see #12377 for details */
SMARTLIST_FOREACH_BEGIN(addrs, tor_addr_t *, a) {
+ char *addr_str;
+ int is_internal;
tor_addr_copy(addr, a);
+ is_internal = tor_addr_is_internal(a, 0);
rv = 0;
+ addr_str = tor_addr_to_str_dup(addr);
+ log_debug(LD_NET, "Found %s interface address '%s'",
+ (is_internal ? "internal" : "external"), addr_str);
+ tor_free(addr_str);
+
/* If we found a non-internal address, declare success. Otherwise,
* keep looking. */
- if (!tor_addr_is_internal(a, 0))
+ if (!is_internal)
break;
} SMARTLIST_FOREACH_END(a);