From 6e6d95b3db091d4ae107c8d4f03354ccadd20757 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 22 Feb 2005 08:18:36 +0000 Subject: Change from inet_ntoa to a threadproof tor_inet_ntoa. svn:r3656 --- src/or/config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/or/config.c') 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; } -- cgit v1.2.3-54-g00ecf