Clarify ReachableAddress log messages

Make it clearer that they are about outgoing connection attempts.
Specify the options involved where they were missing from one log
message.
Clarify a comment.
This commit is contained in:
teor (Tim Wilson-Brown) 2016-03-24 20:59:49 +11:00
parent f2a344e397
commit 355f78364a
3 changed files with 17 additions and 12 deletions

View file

@ -1794,7 +1794,7 @@ connection_connect_log_client_use_ip_version(const connection_t *conn)
if ((must_ipv4 && tor_addr_family(&real_addr) == AF_INET6) if ((must_ipv4 && tor_addr_family(&real_addr) == AF_INET6)
|| (must_ipv6 && tor_addr_family(&real_addr) == AF_INET)) { || (must_ipv6 && tor_addr_family(&real_addr) == AF_INET)) {
static int logged_backtrace = 0; static int logged_backtrace = 0;
log_info(LD_BUG, "%s connection to %s violated ClientUseIPv%s 0.", log_info(LD_BUG, "Outgoing %s connection to %s violated ClientUseIPv%s 0.",
conn->type == CONN_TYPE_OR ? "OR" : "Dir", conn->type == CONN_TYPE_OR ? "OR" : "Dir",
fmt_addr(&real_addr), fmt_addr(&real_addr),
options->ClientUseIPv4 == 0 ? "4" : "6"); options->ClientUseIPv4 == 0 ? "4" : "6");
@ -1814,9 +1814,10 @@ connection_connect_log_client_use_ip_version(const connection_t *conn)
/* Check if we couldn't satisfy an address family preference */ /* Check if we couldn't satisfy an address family preference */
if ((!pref_ipv6 && tor_addr_family(&real_addr) == AF_INET6) if ((!pref_ipv6 && tor_addr_family(&real_addr) == AF_INET6)
|| (pref_ipv6 && tor_addr_family(&real_addr) == AF_INET)) { || (pref_ipv6 && tor_addr_family(&real_addr) == AF_INET)) {
log_info(LD_NET, "Connection to %s doesn't satisfy ClientPreferIPv6%sPort " log_info(LD_NET, "Outgoing connection to %s doesn't satisfy "
"%d, with ClientUseIPv4 %d, and fascist_firewall_use_ipv6 %d " "ClientPreferIPv6%sPort %d, with ClientUseIPv4 %d, and "
"(ClientUseIPv6 %d and UseBridges %d).", "fascist_firewall_use_ipv6 %d (ClientUseIPv6 %d and UseBridges "
"%d).",
fmt_addr(&real_addr), fmt_addr(&real_addr),
conn->type == CONN_TYPE_OR ? "OR" : "Dir", conn->type == CONN_TYPE_OR ? "OR" : "Dir",
conn->type == CONN_TYPE_OR ? options->ClientPreferIPv6ORPort conn->type == CONN_TYPE_OR ? options->ClientPreferIPv6ORPort

View file

@ -672,12 +672,13 @@ directory_choose_address_routerstatus(const routerstatus_t *status,
FIREWALL_DIR_CONNECTION, 0, FIREWALL_DIR_CONNECTION, 0,
use_dir_ap); use_dir_ap);
/* We rejected both addresses. This isn't great. */ /* We rejected all addresses in the relay's status. This means we can't
* connect to it. */
if (!have_or && !have_dir) { if (!have_or && !have_dir) {
static int logged_backtrace = 0; static int logged_backtrace = 0;
log_info(LD_BUG, "Rejected all OR and Dir addresses from %s when " log_info(LD_BUG, "Rejected all OR and Dir addresses from %s when "
"launching a directory connection to: IPv4 %s OR %d Dir %d " "launching an outgoing directory connection to: IPv4 %s OR %d "
"IPv6 %s OR %d Dir %d", routerstatus_describe(status), "Dir %d IPv6 %s OR %d Dir %d", routerstatus_describe(status),
fmt_addr32(status->addr), status->or_port, fmt_addr32(status->addr), status->or_port,
status->dir_port, fmt_addr(&status->ipv6_addr), status->dir_port, fmt_addr(&status->ipv6_addr),
status->ipv6_orport, status->dir_port); status->ipv6_orport, status->dir_port);
@ -1105,7 +1106,8 @@ directory_initiate_command_rend(const tor_addr_port_t *or_addr_port,
if (or_connection && (!or_addr_port->port if (or_connection && (!or_addr_port->port
|| tor_addr_is_null(&or_addr_port->addr))) { || tor_addr_is_null(&or_addr_port->addr))) {
static int logged_backtrace = 0; static int logged_backtrace = 0;
log_warn(LD_DIR, "Cannot make an OR connection without an OR port."); log_warn(LD_DIR, "Cannot make an outgoing OR connection without an OR "
"port.");
if (!logged_backtrace) { if (!logged_backtrace) {
log_backtrace(LOG_INFO, LD_BUG, "Address came from"); log_backtrace(LOG_INFO, LD_BUG, "Address came from");
logged_backtrace = 1; logged_backtrace = 1;
@ -1114,7 +1116,8 @@ directory_initiate_command_rend(const tor_addr_port_t *or_addr_port,
} else if (!or_connection && (!dir_addr_port->port } else if (!or_connection && (!dir_addr_port->port
|| tor_addr_is_null(&dir_addr_port->addr))) { || tor_addr_is_null(&dir_addr_port->addr))) {
static int logged_backtrace = 0; static int logged_backtrace = 0;
log_warn(LD_DIR, "Cannot make a Dir connection without a Dir port."); log_warn(LD_DIR, "Cannot make an outgoing Dir connection without a Dir "
"port.");
if (!logged_backtrace) { if (!logged_backtrace) {
log_backtrace(LOG_INFO, LD_BUG, "Address came from"); log_backtrace(LOG_INFO, LD_BUG, "Address came from");
logged_backtrace = 1; logged_backtrace = 1;

View file

@ -1561,8 +1561,9 @@ router_picked_poor_directory_log(const routerstatus_t *rs)
* This might be a bug. */ * This might be a bug. */
if (!rs) { if (!rs) {
static int logged_backtrace = 0; static int logged_backtrace = 0;
log_info(LD_BUG, "Firewall denied all OR and Dir addresses for all relays " log_info(LD_BUG, "Wanted to make an outgoing directory connection, but "
"when searching for a directory."); "all OR and Dir addresses for all relays were not reachable. "
"Check ReachableAddresses, ClientUseIPv4, and similar options.");
if (!logged_backtrace) { if (!logged_backtrace) {
log_backtrace(LOG_INFO, LD_BUG, "Node search initiated by"); log_backtrace(LOG_INFO, LD_BUG, "Node search initiated by");
logged_backtrace = 1; logged_backtrace = 1;
@ -1571,7 +1572,7 @@ router_picked_poor_directory_log(const routerstatus_t *rs)
&& !fascist_firewall_allows_rs(rs, FIREWALL_DIR_CONNECTION, 1) && !fascist_firewall_allows_rs(rs, FIREWALL_DIR_CONNECTION, 1)
) { ) {
log_info(LD_BUG, "Selected a directory %s with non-preferred OR and Dir " log_info(LD_BUG, "Selected a directory %s with non-preferred OR and Dir "
"addresses for launching a connection: " "addresses for launching an outgoing connection: "
"IPv4 %s OR %d Dir %d IPv6 %s OR %d Dir %d", "IPv4 %s OR %d Dir %d IPv6 %s OR %d Dir %d",
routerstatus_describe(rs), routerstatus_describe(rs),
fmt_addr32(rs->addr), rs->or_port, fmt_addr32(rs->addr), rs->or_port,