diff options
author | Roger Dingledine <arma@torproject.org> | 2004-04-28 20:11:37 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-04-28 20:11:37 +0000 |
commit | 22c0cd8a14bab94606c434570f361ac622a83a3e (patch) | |
tree | 86771e4e7411198f78fca88744bc805d803e1de8 /src/or/dns.c | |
parent | fd0d48e4843de1ad8d6dda7ff91bd505887d5889 (diff) | |
download | tor-22c0cd8a14bab94606c434570f361ac622a83a3e.tar tor-22c0cd8a14bab94606c434570f361ac622a83a3e.tar.gz |
clean dns.c better
svn:r1737
Diffstat (limited to 'src/or/dns.c')
-rw-r--r-- | src/or/dns.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index 29ae69ced..c4a081da8 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -451,6 +451,7 @@ int dnsworker_main(void *data) { char address[MAX_ADDRESSLEN]; unsigned char address_len; char answer[5]; + uint32_t ip; int *fdarray = data; int fd; @@ -475,7 +476,7 @@ int dnsworker_main(void *data) { address[address_len] = 0; /* null terminate it */ /* XXX isn't this non-aligned uint32 going to cause problems? */ - switch (tor_lookup_hostname(address, (uint32_t*)answer+1)) { + switch (tor_lookup_hostname(address, &ip)) { case 1: log_fn(LOG_INFO,"Could not resolve dest addr %s (transient).",address); answer[0] = DNS_RESOLVE_FAILED_TRANSIENT; @@ -489,6 +490,7 @@ int dnsworker_main(void *data) { answer[0] = DNS_RESOLVE_SUCCEEDED; break; } + set_uint32(answer+1, ip); if(write_all(fd, answer, 5, 1) != 5) { log_fn(LOG_ERR,"writing answer failed. Child exiting."); spawn_exit(); |