diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-03-24 10:38:07 +1100 |
---|---|---|
committer | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-03-24 10:39:23 +1100 |
commit | f2a344e3974eeba860434884bd70f8d11cca94ea (patch) | |
tree | 543d199f715730999ad2d45db1bdb04ea2b4f24a /src/or/directory.c | |
parent | 45681f695c6096e280bc7ec3bf0a67c27708dbbc (diff) | |
download | tor-f2a344e3974eeba860434884bd70f8d11cca94ea.tar.gz tor-f2a344e3974eeba860434884bd70f8d11cca94ea.zip |
Downgrade IP version warnings to avoid filling logs
Downgrade logs and backtraces about IP versions to
info-level. Only log backtraces once each time tor runs.
Assists in diagnosing bug 18351; bugfix on c3cc8e16e in
tor-0.2.8.1-alpha.
Reported by "sysrqb" and "Christian", patch by "teor".
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index e4feda44fc..c95944b6f2 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -674,13 +674,17 @@ directory_choose_address_routerstatus(const routerstatus_t *status, /* We rejected both addresses. This isn't great. */ if (!have_or && !have_dir) { - log_warn(LD_BUG, "Rejected all OR and Dir addresses from %s when " + static int logged_backtrace = 0; + log_info(LD_BUG, "Rejected all OR and Dir addresses from %s when " "launching a directory connection to: IPv4 %s OR %d Dir %d " "IPv6 %s OR %d Dir %d", routerstatus_describe(status), fmt_addr32(status->addr), status->or_port, status->dir_port, fmt_addr(&status->ipv6_addr), status->ipv6_orport, status->dir_port); - log_backtrace(LOG_WARN, LD_BUG, "Addresses came from"); + if (!logged_backtrace) { + log_backtrace(LOG_INFO, LD_BUG, "Addresses came from"); + logged_backtrace = 1; + } return -1; } @@ -1100,14 +1104,21 @@ directory_initiate_command_rend(const tor_addr_port_t *or_addr_port, if (or_connection && (!or_addr_port->port || tor_addr_is_null(&or_addr_port->addr))) { + static int logged_backtrace = 0; log_warn(LD_DIR, "Cannot make an OR connection without an OR port."); - log_backtrace(LOG_WARN, LD_BUG, "Address came from"); + if (!logged_backtrace) { + log_backtrace(LOG_INFO, LD_BUG, "Address came from"); + logged_backtrace = 1; + } return; } else if (!or_connection && (!dir_addr_port->port || tor_addr_is_null(&dir_addr_port->addr))) { + static int logged_backtrace = 0; log_warn(LD_DIR, "Cannot make a Dir connection without a Dir port."); - log_backtrace(LOG_WARN, LD_BUG, "Address came from"); - + if (!logged_backtrace) { + log_backtrace(LOG_INFO, LD_BUG, "Address came from"); + logged_backtrace = 1; + } return; } |