Don't use OutboundBindAddress to connect to localhost
commitd4354b506be924853cae838881202b205b4d45f2
authorNick Mathewson <nickm@torproject.org>
Wed, 20 Jan 2010 17:36:14 +0000 (20 12:36 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 20 Jan 2010 18:09:10 +0000 (20 13:09 -0500)
tree6bb2302e91777f60580bcf57201b433e66a98f69
parentc939509051f90d7276355783b255d4a15730efab
Don't use OutboundBindAddress to connect to localhost

The OutboundBindAddress option is useful for making sure that all of
your outbond connections use a given interface.  But when connecting
to 127.0.0.1 (or ::1 even) it's important to actually have the
connection come _from_ localhost, since lots of programs running on
localhost use the source address to authenticate that the connection
is really coming from the same host.

Our old code always bound to OutboundBindAddress, whether connecting
to localhost or not.  This would potentially break DNS servers on
localhost, and socks proxies on localhost.  This patch changes the
behavior so that we only look at OutboundBindAddress when connecting
to a non-loopback address.
ChangeLog
src/or/connection.c
src/or/eventdns.c