[or-cvs] r9095: Fix a bug in 0.1.2.2-alpha that prevented clients from askin (in tor/trunk: . src/or)

arma at seul.org arma at seul.org
Tue Dec 12 20:23:20 UTC 2006


Author: arma
Date: 2006-12-12 15:23:17 -0500 (Tue, 12 Dec 2006)
New Revision: 9095

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/circuituse.c
   tor/trunk/src/or/or.h
Log:
Fix a bug in 0.1.2.2-alpha that prevented clients from asking
to resolve an address at a given exit node even when they ask for
it by name.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2006-12-12 20:20:48 UTC (rev 9094)
+++ tor/trunk/ChangeLog	2006-12-12 20:23:17 UTC (rev 9095)
@@ -25,6 +25,9 @@
     - Fix a bug on the Windows implementation of tor_mmap_file that
       would prevent the cached-routers file from ever loading. (reported by
       John Kimble.)
+    - Fix a bug in 0.1.2.2-alpha that prevented clients from asking
+      to resolve an address at a given exit node even when they ask for
+      it by name.
 
   o Security bugfixes:
     - Do not log introduction points for hidden services if SafeLogging

Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2006-12-12 20:20:48 UTC (rev 9094)
+++ tor/trunk/src/or/circuituse.c	2006-12-12 20:23:17 UTC (rev 9095)
@@ -1182,7 +1182,7 @@
         }
         return -1;
       }
-      if (conn->_base.purpose != EXIT_PURPOSE_RESOLVE &&
+      if (!SOCKS_COMMAND_IS_RESOLVE(conn->socks_request->command) &&
           !connection_ap_can_use_exit(conn, router)) {
         log_fn(opt ? LOG_INFO : LOG_WARN, LD_APP,
                "Requested exit point '%s' would refuse request. %s.",

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2006-12-12 20:20:48 UTC (rev 9094)
+++ tor/trunk/src/or/or.h	2006-12-12 20:23:17 UTC (rev 9095)
@@ -1712,6 +1712,10 @@
 #define SOCKS_COMMAND_CONNECT 0x01
 #define SOCKS_COMMAND_RESOLVE 0xF0
 #define SOCKS_COMMAND_RESOLVE_PTR 0xF1
+
+#define SOCKS_COMMAND_IS_RESOLVE(c) ((c)==SOCKS_COMMAND_RESOLVE || \
+                                     (c)==SOCKS_COMMAND_RESOLVE_PTR)
+
 /** State of a SOCKS request from a user to an OP */
 struct socks_request_t {
   char socks_version; /**< Which version of SOCKS did the client use? */



More information about the tor-commits mailing list