Bug 40828: Add more log scrubbing to protocol warnings

This commit is contained in:
Mike Perry 2023-07-31 14:12:39 +00:00
parent 4667195ded
commit 74d6fd534a
4 changed files with 6 additions and 6 deletions

View File

@ -1271,8 +1271,8 @@ run_connection_housekeeping(int i, time_t now)
log_fn(LOG_PROTOCOL_WARN,LD_PROTOCOL,
"Expiring stuck OR connection to fd %d (%s:%d). (%d bytes to "
"flush; %d seconds since last write)",
(int)conn->s, fmt_and_decorate_addr(&conn->addr), conn->port,
(int)connection_get_outbuf_len(conn),
(int)conn->s, safe_str(fmt_and_decorate_addr(&conn->addr)),
conn->port, (int)connection_get_outbuf_len(conn),
(int)(now-conn->timestamp_last_write_allowed));
connection_or_close_normally(TO_OR_CONN(conn), 0);
} else if (past_keepalive && !connection_get_outbuf_len(conn)) {

View File

@ -1469,7 +1469,7 @@ connection_edge_process_relay_cell_not_open(
(get_options()->ClientDNSRejectInternalAddresses &&
tor_addr_is_internal(&addr, 0))) {
log_info(LD_APP, "...but it claims the IP address was %s. Closing.",
fmt_addr(&addr));
safe_str(fmt_addr(&addr)));
connection_edge_end(conn, END_STREAM_REASON_TORPROTOCOL);
connection_mark_unattached_ap(entry_conn,
END_STREAM_REASON_TORPROTOCOL);
@ -1480,7 +1480,7 @@ connection_edge_process_relay_cell_not_open(
(family == AF_INET6 && ! entry_conn->entry_cfg.ipv6_traffic)) {
log_fn(LOG_PROTOCOL_WARN, LD_APP,
"Got a connected cell to %s with unsupported address family."
" Closing.", fmt_addr(&addr));
" Closing.", safe_str(fmt_addr(&addr)));
connection_edge_end(conn, END_STREAM_REASON_TORPROTOCOL);
connection_mark_unattached_ap(entry_conn,
END_STREAM_REASON_TORPROTOCOL);

View File

@ -1680,7 +1680,7 @@ hs_get_extend_info_from_lspecs(const smartlist_t *lspecs,
if (!extend_info_addr_is_allowed(&ap.addr)) {
log_fn(LOG_PROTOCOL_WARN, LD_REND,
"Requested address is private and we are not allowed to extend to "
"it: %s:%u", fmt_addr(&ap.addr), ap.port);
"it: %s:%u", safe_str(fmt_addr(&ap.addr)), ap.port);
goto done;
}

View File

@ -78,7 +78,7 @@ relay_address_new_suggestion(const tor_addr_t *suggested_addr,
/* Do not believe anyone who says our address is their address. */
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
"A relay endpoint %s is telling us that their address is ours.",
fmt_addr(peer_addr));
safe_str(fmt_addr(peer_addr)));
return;
}