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

Re: breaks relay on OSX PPC

On Mon, Mar 01, 2010 at 08:43:47PM -0500, Roger Dingledine wrote:
> On Mon, Mar 01, 2010 at 08:38:22PM -0500, downie - wrote:
> > thanks, found the right Tor-only bundles.
> > is broken in the same way.
> > Going back to works fine.
> While we're at it, can you try out the development branches? My
> guess is that will work fine and will
> be broken for you. But it would be good to confirm. :)

Here's what I think will fix it. Somebody in the following situation
should test it (with and without the patch):

As I understand it, the bug should show up on relays that don't set
Address to an IP address (so they need to resolve their Address line or
their hostname to guess their IP address), and their hostname or Address
line fails to resolve -- at that point they'll pick a random 4 bytes
out of memory and call that their address. At the same time, relays that
*do* successfully resolve their address will ignore the result, and only
come up with a useful address if their interface address happens to be
a public IP address.

So much for backporting only well-tested bugfixes. :( Thanks for pointing
it out quickly at least!


diff --git a/src/or/config.c b/src/or/config.c
index 26d6644..c9f8e6b 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2367,7 +2367,7 @@ resolve_my_address(int warn_severity, or_options_t *option
   if (tor_inet_aton(hostname, &in) == 0) {
     /* then we have to resolve it */
     explicit_ip = 0;
-    if(!tor_lookup_hostname(hostname, &addr)) {
+    if(tor_lookup_hostname(hostname, &addr)) { /* failed to resolve */
       uint32_t interface_ip;
       if (explicit_hostname) {