[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

tsocks patch to support tor's mapaddress



Hi folks,

I just noticed that tsocks hard-codes the 127.0.0.0/8 subnet
as being "local", meaning it won't ever go through the socks
proxy.

The Tor controller's mapaddress command can assign virtual addresses
in the 127/8 space: see section 3.8 of
http://tor.eff.org/cvs/tor/doc/control-spec.txt

We think this behavior should be allowed. Here's a patch to tsocks to
make it not always hard-code its local network.

I'll also link to this from
http://wiki.noreply.org/noreply/TheOnionRouter/TSocksPatches
and perhaps one day somebody will maintain a forked tsocks with all
these patches?


--- parser.c.old        2006-04-01 17:54:46.687832056 -0500
+++ parser.c    2006-04-01 17:55:47.552579208 -0500
@@ -74,8 +74,10 @@
                } 
                fclose(conf);
 
-               /* Always add the 127.0.0.1/255.0.0.0 subnet to local */
-               handle_local(config, 0, "127.0.0.0/255.0.0.0");
+               if (!config->localnets) {
+                       /* Use 127.0.0.1/255.0.0.0 by default */
+                       handle_local(config, 0, "127.0.0.0/255.0.0.0");
+               }
 
                /* Check default server */
                check_server(&(config->defaultserver));