diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-02-22 08:18:36 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-02-22 08:18:36 +0000 |
commit | 6e6d95b3db091d4ae107c8d4f03354ccadd20757 (patch) | |
tree | 1c5799dcfb490b15934adffa42a564d9a47f8a91 /src/or/config.c | |
parent | e8da6b26b62475114937077e88905be921937554 (diff) | |
download | tor-6e6d95b3db091d4ae107c8d4f03354ccadd20757.tar.gz tor-6e6d95b3db091d4ae107c8d4f03354ccadd20757.zip |
Change from inet_ntoa to a threadproof tor_inet_ntoa.
svn:r3656
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c index aeaa538177..2e69de2602 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -928,6 +928,7 @@ resolve_my_address(const char *address, uint32_t *addr) struct hostent *rent; char hostname[256]; int explicit_ip=1; + char tmpbuf[INET_NTOA_BUF_LEN]; tor_assert(addr); @@ -957,14 +958,15 @@ resolve_my_address(const char *address, uint32_t *addr) memcpy(&in.s_addr, rent->h_addr, rent->h_length); } + tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf)); if (!explicit_ip && is_internal_IP(htonl(in.s_addr))) { log_fn(LOG_WARN,"Address '%s' resolves to private IP '%s'. " "Please set the Address config option to be the IP you want to use.", - hostname, inet_ntoa(in)); + hostname, tmpbuf); return -1; } - log_fn(LOG_DEBUG, "Resolved Address to %s.", inet_ntoa(in)); + log_fn(LOG_DEBUG, "Resolved Address to %s.", tmpbuf); *addr = ntohl(in.s_addr); return 0; } |