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

Re: 0.2.1.24 breaks relay on OSX PPC



On Tue, Mar 02, 2010 at 00:43:42PM -0500, Roger Dingledine wrote:
> 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!
>
> --Roger
>
> 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) {


That patch fixed the problem on my Mac OX X 10.5.8 system running tor
0.2.1.24 in Vidalia.  (I built tor from the patched 0.2.1.24 source
tarball, and slipped it into Vidalia.app/Contents/MacOS/tor.)

Prior to the patch, tor was picking random addresses, then discarding them
for various reasons (private, etc.) and trying again.  (The hostname on my
relay does not resolve to an IP address because of an ongoing dynamic DNS
failure.)

With the patch, tor is apparently using the host's IP address, which is
externally reachable, without complaint.  Relay traffic is picking up again
at the rate I expect.


Richard