diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-09-04 18:27:40 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-09-04 18:27:40 +0000 |
commit | 6ba66c2f42862c937b43899331d22e11db0ef149 (patch) | |
tree | a3c9a7b91bff977d6eb35f9c8960d171255c8b86 /src/tools | |
parent | eca3634f62d3739c83b13a90d6dbb3fcfd3600cf (diff) | |
download | tor-6ba66c2f42862c937b43899331d22e11db0ef149.tar.gz tor-6ba66c2f42862c937b43899331d22e11db0ef149.zip |
r14323@kushana: nickm | 2007-09-04 14:27:33 -0400
Patch from sjmurdoch to fix dnsleak warning when reverse-resolving via socks5.
svn:r11373
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/tor-resolve.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c index e6561443bf..f387f9fa9f 100644 --- a/src/tools/tor-resolve.c +++ b/src/tools/tor-resolve.c @@ -79,14 +79,14 @@ build_socks_resolve_request(char **out, log_err(LD_GENERAL, "Tried to do a reverse lookup on a non-IP!"); return -1; } - addrlen = is_ip_address ? 4 : 1 + strlen(hostname); + addrlen = reverse ? 4 : 1 + strlen(hostname); len = 6 + addrlen; *out = tor_malloc(len); (*out)[0] = 5; /* SOCKS version 5 */ (*out)[1] = reverse ? '\xF1' : '\xF0'; /* RESOLVE_PTR or RESOLVE */ (*out)[2] = 0; /* reserved. */ - (*out)[3] = is_ip_address ? 1 : 3; - if (is_ip_address) { + (*out)[3] = reverse ? 1 : 3; + if (reverse) { set_uint32((*out)+4, in.s_addr); } else { (*out)[4] = (char)(uint8_t)(addrlen - 1); |