aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/circuitbuild_relay.c
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-04-15 09:55:09 +1000
committerteor <teor@torproject.org>2020-04-29 22:43:09 +1000
commit44f71e08c414f6c7aad6304e24be90d5d320c95b (patch)
tree232525c99a97e95cb53cbec048fd63f7e9fc8369 /src/feature/relay/circuitbuild_relay.c
parenta72e017e7f69581ceb005d05ce8033a6fd05626e (diff)
downloadtor-44f71e08c414f6c7aad6304e24be90d5d320c95b.tar.gz
tor-44f71e08c414f6c7aad6304e24be90d5d320c95b.zip
relay: Log the address in circuit protocol warnings
Always log the address family in extend protocol warnings. If SafeLogging is 0, also log the address and port. Diagnostics for 33817.
Diffstat (limited to 'src/feature/relay/circuitbuild_relay.c')
-rw-r--r--src/feature/relay/circuitbuild_relay.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/feature/relay/circuitbuild_relay.c b/src/feature/relay/circuitbuild_relay.c
index dd38a28258..05146f1b67 100644
--- a/src/feature/relay/circuitbuild_relay.c
+++ b/src/feature/relay/circuitbuild_relay.c
@@ -130,16 +130,24 @@ static int
circuit_extend_addr_port_helper(const struct tor_addr_port_t *ap,
int log_level)
{
+ /* It's safe to print the family. But we don't want to print the address,
+ * unless specifically configured to do so. (Zero addresses aren't sensitive,
+ * But some internal addresses might be.)*/
+
if (!tor_addr_port_is_valid_ap(ap, 0)) {
log_fn(log_level, LD_PROTOCOL,
- "Client asked me to extend to zero destination port or addr.");
+ "Client asked me to extend to a zero destination port or "
+ "%s address '%s'.",
+ fmt_addr_family(&ap->addr), safe_str(fmt_addrport_ap(ap)));
return -1;
}
if (tor_addr_is_internal(&ap->addr, 0) &&
!get_options()->ExtendAllowPrivateAddresses) {
log_fn(log_level, LD_PROTOCOL,
- "Client asked me to extend to a private address.");
+ "Client asked me to extend to a private %s address '%s'.",
+ fmt_addr_family(&ap->addr),
+ safe_str(fmt_and_decorate_addr(&ap->addr)));
return -1;
}