summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-03-24 10:38:07 +1100
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-03-24 10:39:23 +1100
commitf2a344e3974eeba860434884bd70f8d11cca94ea (patch)
tree543d199f715730999ad2d45db1bdb04ea2b4f24a /src/or/connection.c
parent45681f695c6096e280bc7ec3bf0a67c27708dbbc (diff)
downloadtor-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/connection.c')
-rw-r--r--src/or/connection.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 4e915f1213..fc9ec13c41 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1793,11 +1793,15 @@ connection_connect_log_client_use_ip_version(const connection_t *conn)
/* Check if we broke a mandatory address family restriction */
if ((must_ipv4 && tor_addr_family(&real_addr) == AF_INET6)
|| (must_ipv6 && tor_addr_family(&real_addr) == AF_INET)) {
- log_warn(LD_BUG, "%s connection to %s violated ClientUseIPv%s 0.",
+ static int logged_backtrace = 0;
+ log_info(LD_BUG, "%s connection to %s violated ClientUseIPv%s 0.",
conn->type == CONN_TYPE_OR ? "OR" : "Dir",
fmt_addr(&real_addr),
options->ClientUseIPv4 == 0 ? "4" : "6");
- log_backtrace(LOG_WARN, LD_BUG, "Address came from");
+ if (!logged_backtrace) {
+ log_backtrace(LOG_INFO, LD_BUG, "Address came from");
+ logged_backtrace = 1;
+ }
}
/* Bridges are allowed to break IPv4/IPv6 ORPort preferences to connect to