[or-cvs] r11373: Patch from sjmurdoch to fix dnsleak warning when reverse-res (in tor/trunk: . src/tools)

nickm at seul.org nickm at seul.org
Tue Sep 4 18:27:41 UTC 2007


Author: nickm
Date: 2007-09-04 14:27:40 -0400 (Tue, 04 Sep 2007)
New Revision: 11373

Modified:
   tor/trunk/
   tor/trunk/src/tools/tor-resolve.c
Log:
 r14323 at kushana:  nickm | 2007-09-04 14:27:33 -0400
 Patch from sjmurdoch to fix dnsleak warning when reverse-resolving via socks5.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r14323] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/src/tools/tor-resolve.c
===================================================================
--- tor/trunk/src/tools/tor-resolve.c	2007-09-04 15:33:12 UTC (rev 11372)
+++ tor/trunk/src/tools/tor-resolve.c	2007-09-04 18:27:40 UTC (rev 11373)
@@ -79,14 +79,14 @@
       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);



More information about the tor-commits mailing list