patch: router.exit -> localhost.router.exit

Geoffrey Goodell goodell at cassandra.eecs.harvard.edu
Mon May 9 17:14:46 UTC 2005


After some testing, I determined that the patch that I sent yesterday
does not provide the functionality that I want, but this new patch does.
Please consider this one instead.  Thanks!

Geoff

On Mon, May 09, 2005 at 02:56:12AM -0400, Geoffrey Goodell wrote:
> Please consider this patch, which provides the following functionality:
> 
> If a user specifies router.exit, then rather than rejecting the
> connection, try to connect to 127.0.0.1 on the specified exit node.
> 
> Geoff

-------------- next part --------------
Only in or: CVS
diff -u or/connection_edge.c or.patch/connection_edge.c
--- or/connection_edge.c	2005-05-07 01:55:06.000000000 -0400
+++ or.patch/connection_edge.c	2005-05-09 13:01:47.000000000 -0400
@@ -914,7 +914,13 @@
   if (addresstype == EXIT_HOSTNAME) {
     /* .exit -- modify conn to specify the exit node. */
     char *s = strrchr(socks->address,'.');
-    if (!s || s[1] == '\0') {
+    if (!s) {
+      char *orig = tor_strdup(socks->address);
+      strlcpy(socks->address, "127.0.0.1.", sizeof(socks->address));
+      strlcat(socks->address, orig, sizeof(socks->address));
+      s = strrchr(socks->address,'.');
+    }
+    if (s[1] == '\0') {
       log_fn(LOG_WARN,"Malformed exit address '%s'. Refusing.",
              safe_str(socks->address));
       connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20050509/1b7d177d/attachment.pgp>


More information about the tor-dev mailing list