/* now see if we're already connected to the first OR in 'route' */
log_debug(LD_CIRC,"Looking for firsthop '%s:%u'",
- fmt_addr(&firsthop->extend_info->addr),
+ fmt_and_decorate_addr(&firsthop->extend_info->addr),
firsthop->extend_info->port);
n_conn = connection_or_get_for_extend(firsthop->extend_info->identity_digest,
if (!n_conn) {
log_debug(LD_CIRC|LD_OR,"Next router (%s:%d): %s",
- fmt_addr(&n_addr), (int)n_port, msg?msg:"????");
+ fmt_and_decorate_addr(&n_addr), (int)n_port, msg?msg:"????");
circ->n_hop = extend_info_new(NULL /*nickname*/,
id_digest,
if (bridge && tor_digest_is_zero(bridge->identity)) {
memcpy(bridge->identity, digest, DIGEST_LEN);
log_notice(LD_DIR, "Learned fingerprint %s for bridge %s:%d",
- hex_str(digest, DIGEST_LEN), fmt_addr(addr), port);
+ hex_str(digest, DIGEST_LEN), fmt_and_decorate_addr(addr), port);
}
}
/* warn the user */
char *bridge_description_new, *bridge_description_old;
tor_asprintf(&bridge_description_new, "%s:%u:%s:%s",
- fmt_addr(addr), port,
+ fmt_and_decorate_addr(addr), port,
digest ? hex_str(digest, DIGEST_LEN) : "",
transport_name ? transport_name : "");
tor_asprintf(&bridge_description_old, "%s:%u:%s:%s",
- fmt_addr(&bridge->addr), bridge->port,
+ fmt_and_decorate_addr(&bridge->addr), bridge->port,
tor_digest_is_zero(bridge->identity) ?
"" : hex_str(bridge->identity,DIGEST_LEN),
bridge->transport_name ? bridge->transport_name : "");
if (routerset_contains_bridge(options->ExcludeNodes, bridge)) {
download_status_mark_impossible(&bridge->fetch_status);
log_warn(LD_APP, "Not using bridge at %s: it is in ExcludeNodes.",
- safe_str_client(fmt_addr(&bridge->addr)));
+ safe_str_client(fmt_and_decorate_addr(&bridge->addr)));
return;
}
if (routerset_contains_bridge(options->ExcludeNodes, bridge)) {
download_status_mark_impossible(&bridge->fetch_status);
log_warn(LD_APP, "Not using bridge at %s: it is in ExcludeNodes.",
- safe_str_client(fmt_addr(&bridge->addr)));
+ safe_str_client(fmt_and_decorate_addr(&bridge->addr)));
continue;
}
if (ask_bridge_directly &&
!fascist_firewall_allows_address_or(&bridge->addr, bridge->port)) {
log_notice(LD_DIR, "Bridge at '%s:%d' isn't reachable by our "
- "firewall policy. %s.", fmt_addr(&bridge->addr),
+ "firewall policy. %s.",
+ fmt_and_decorate_addr(&bridge->addr),
bridge->port,
can_use_bridge_authority ?
"Asking bridge authority instead" : "Skipping");
log_info(LD_DIR,
"Adjusted bridge routerinfo for '%s' to match configured "
"address %s:%d.",
- ri->nickname, fmt_addr(&ri->ipv6_addr), ri->ipv6_orport);
+ ri->nickname, fmt_and_decorate_addr(&ri->ipv6_addr),
+ ri->ipv6_orport);
} else {
log_err(LD_BUG, "Address family not supported: %d.",
tor_addr_family(&bridge->addr));
"Will prefer using its %s address (%s:%d).",
ri->nickname,
tor_addr_family(&ap.addr) == AF_INET6 ? "IPv6" : "IPv4",
- fmt_addr(&ap.addr), ap.port);
+ fmt_and_decorate_addr(&ap.addr), ap.port);
}
}
if (node->rs) {
log_info(LD_DIR,
"Adjusted bridge routerstatus for '%s' to match "
"configured address %s:%d.",
- rs->nickname, fmt_addr(&bridge->addr), rs->or_port);
+ rs->nickname, fmt_and_decorate_addr(&bridge->addr),
+ rs->or_port);
}
}
}
if (!validate_only) {
log_debug(LD_DIR, "Bridge at %s:%d (transport: %s) (%s)",
- fmt_addr(&addr), (int)port,
+ fmt_and_decorate_addr(&addr), (int)port,
transport_name ? transport_name : "no transport",
fingerprint ? fingerprint : "no key listed");
bridge_add_from_config(&addr, port,
socks_ver);
log_info(LD_DIR, "Transport '%s' found at %s:%d",
- transports, fmt_addr(&addr), (int)port);
+ transports, fmt_and_decorate_addr(&addr), (int)port);
}
}
if (!validate_only) {
log_info(LD_DIR, "Server transport '%s' at %s:%d.",
- transports, fmt_addr(&addr), (int)port);
+ transports, fmt_and_decorate_addr(&addr), (int)port);
}
}
"Other people on the Internet might find your computer and "
"use it as an open proxy. Please don't allow this unless you "
"have a good reason.",
- fmt_addr(&port->addr), port->port, portname);
+ fmt_and_decorate_addr(&port->addr), port->port, portname);
} else if (!tor_addr_is_loopback(&port->addr)) {
log_notice(LD_CONFIG, "You configured a non-loopback address '%s:%d' "
"for %sPort. This allows everybody on your local network to "
"use your machine as a proxy. Make sure this is what you "
"wanted.",
- fmt_addr(&port->addr), port->port, portname);
+ fmt_and_decorate_addr(&port->addr), port->port, portname);
}
} SMARTLIST_FOREACH_END(port);
}
tor_addr_from_sockaddr(&addr, listensockaddr, &usePort);
log_notice(LD_NET, "Opening %s on %s:%d",
- conn_type_to_string(type), fmt_addr(&addr), usePort);
+ conn_type_to_string(type), fmt_and_decorate_addr(&addr),
+ usePort);
s = tor_open_socket(tor_addr_family(&addr),
is_tcp ? SOCK_STREAM : SOCK_DGRAM,
if (socks_policy_permits_address(&addr) == 0) {
log_notice(LD_APP,
"Denying socks connection from untrusted address %s.",
- fmt_addr(&addr));
+ fmt_and_decorate_addr(&addr));
tor_close_socket(news);
return 0;
}
/* check dirpolicy to see if we should accept it */
if (dir_policy_permits_address(&addr) == 0) {
log_notice(LD_DIRSERV,"Denying dir connection from address %s.",
- fmt_addr(&addr));
+ fmt_and_decorate_addr(&addr));
tor_close_socket(news);
return 0;
}
if (ext_addr_len == 0) {
log_warn(LD_NET,
"Error converting OutboundBindAddress %s into sockaddr. "
- "Ignoring.", fmt_addr(ext_addr));
+ "Ignoring.", fmt_and_decorate_addr(ext_addr));
} else {
if (bind(s, (struct sockaddr *) &ext_addr_sa, ext_addr_len) < 0) {
*socket_error = tor_socket_errno(s);
log_warn(LD_NET,"Error binding network socket to %s: %s",
- fmt_addr(ext_addr),
+ fmt_and_decorate_addr(ext_addr),
tor_socket_strerror(*socket_error));
tor_close_socket(s);
return -1;
log_warn(LD_NET,
"The connection to the %s proxy server at %s:%u just failed. "
"Make sure that the proxy server is up and running.",
- proxy_type_to_string(get_proxy_type()), fmt_addr(&proxy_addr),
+ proxy_type_to_string(get_proxy_type()),
+ fmt_and_decorate_addr(&proxy_addr),
proxy_port);
}
log_info(LD_EXIT,"Exit connection to %s:%u (%s) established.",
escaped_safe_str(conn->address), conn->port,
- safe_str(fmt_addr(&conn->addr)));
+ safe_str(fmt_and_decorate_addr(&conn->addr)));
rep_hist_note_exit_stream_opened(conn->port);
"transport proxy supporting '%s'. This can happen if you "
"haven't provided a ClientTransportPlugin line, or if "
"your pluggable transport proxy stopped running.",
- fmt_addr(&TO_CONN(conn)->addr), TO_CONN(conn)->port,
+ fmt_and_decorate_addr(&TO_CONN(conn)->addr),
+ TO_CONN(conn)->port,
transport_name, transport_name);
} else {
log_warn(LD_GENERAL, "Tried to connect to '%s:%u' through a proxy, but "
"the proxy address could not be found.",
- fmt_addr(&TO_CONN(conn)->addr), TO_CONN(conn)->port);
+ fmt_and_decorate_addr(&TO_CONN(conn)->addr),
+ TO_CONN(conn)->port);
}
connection_free(TO_CONN(conn));
for (i = 0; i < smartlist_len(service->ports); ++i) {
p = smartlist_get(service->ports, i);
log_debug(LD_REND,"Service maps port %d to %s:%d",
- p->virtual_port, fmt_addr(&p->real_addr), p->real_port);
+ p->virtual_port, fmt_and_decorate_addr(&p->real_addr),
+ p->real_port);
}
}
}
t_tmp->marked_for_removal = 0;
return 1;
} else { /* same name but different addrport */
- char *new_transport_addr = tor_strdup(fmt_addr(&t->addr));
+ char *new_transport_addr = tor_strdup(fmt_and_decorate_addr(&t->addr));
if (t_tmp->marked_for_removal) { /* marked for removal */
log_notice(LD_GENERAL, "You tried to add transport '%s' at '%s:%u' "
"but there was already a transport marked for deletion at "
"'%s:%u'. We deleted the old transport and registered the "
"new one.", t->name, new_transport_addr, t->port,
- fmt_addr(&t_tmp->addr), t_tmp->port);
+ fmt_and_decorate_addr(&t_tmp->addr), t_tmp->port);
smartlist_remove(transport_list, t_tmp);
transport_free(t_tmp);
tor_free(new_transport_addr);
log_notice(LD_GENERAL, "You tried to add transport '%s' at '%s:%u' "
"but the same transport already exists at '%s:%u'. "
"Skipping.", t->name, new_transport_addr, t->port,
- fmt_addr(&t_tmp->addr), t_tmp->port);
+ fmt_and_decorate_addr(&t_tmp->addr), t_tmp->port);
tor_free(new_transport_addr);
return -1;
}
case -1:
default:
log_notice(LD_GENERAL, "Could not add transport %s at %s:%u. Skipping.",
- t->name, fmt_addr(&t->addr), t->port);
+ t->name, fmt_and_decorate_addr(&t->addr), t->port);
transport_free(t);
return -1;
case 1:
log_info(LD_GENERAL, "Succesfully registered transport %s at %s:%u.",
- t->name, fmt_addr(&t->addr), t->port);
+ t->name, fmt_and_decorate_addr(&t->addr), t->port);
transport_free(t); /* falling */
return 0;
case 0:
log_info(LD_GENERAL, "Succesfully registered transport %s at %s:%u.",
- t->name, fmt_addr(&t->addr), t->port);
+ t->name, fmt_and_decorate_addr(&t->addr), t->port);
return 0;
}
}
SMARTLIST_FOREACH_BEGIN(mp->transports, transport_t *, t) {
save_transport_to_state(t->name, &t->addr, t->port);
log_notice(LD_GENERAL, "Registered server transport '%s' at '%s:%d'",
- t->name, fmt_addr(&t->addr), (int)t->port);
+ t->name, fmt_and_decorate_addr(&t->addr), (int)t->port);
} SMARTLIST_FOREACH_END(t);
}