diff options
author | Roger Dingledine <arma@torproject.org> | 2010-10-01 21:31:09 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2010-10-01 21:31:09 -0400 |
commit | 22f723e4a3fc32983480c7403af9d7e77a3200ea (patch) | |
tree | b33e4fec4ffa0e350e5c4193e050cb3441e2958e /src/or/relay.c | |
parent | 165aaf560a7249a388e916659d55ec6fa1d2fd24 (diff) | |
download | tor-22f723e4a3fc32983480c7403af9d7e77a3200ea.tar.gz tor-22f723e4a3fc32983480c7403af9d7e77a3200ea.zip |
refactor all these tor_inet_ntoa idioms
but don't refactor the ones that look messy
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index f9a44cf16a..05af38e700 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -906,12 +906,8 @@ connection_edge_process_relay_cell_not_open( int ttl; if (!addr || (get_options()->ClientDNSRejectInternalAddresses && is_internal_IP(addr, 0))) { - char buf[INET_NTOA_BUF_LEN]; - struct in_addr a; - a.s_addr = htonl(addr); - tor_inet_ntoa(&a, buf, sizeof(buf)); - log_info(LD_APP, - "...but it claims the IP address was %s. Closing.", buf); + log_info(LD_APP, "...but it claims the IP address was %s. Closing.", + fmt_addr32(addr)); connection_edge_end(conn, END_STREAM_REASON_TORPROTOCOL); connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL); return 0; @@ -988,11 +984,8 @@ connection_edge_process_relay_cell_not_open( uint32_t addr = ntohl(get_uint32(cell->payload+RELAY_HEADER_SIZE+2)); if (get_options()->ClientDNSRejectInternalAddresses && is_internal_IP(addr, 0)) { - char buf[INET_NTOA_BUF_LEN]; - struct in_addr a; - a.s_addr = htonl(addr); - tor_inet_ntoa(&a, buf, sizeof(buf)); - log_info(LD_APP,"Got a resolve with answer %s. Rejecting.", buf); + log_info(LD_APP,"Got a resolve with answer %s. Rejecting.", + fmt_addr32(addr)); connection_ap_handshake_socks_resolved(conn, RESOLVED_TYPE_ERROR_TRANSIENT, 0, NULL, 0, TIME_MAX); |