]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Apply Roger's bug 1269 fix.
authorNick Mathewson <nickm@torproject.org>
Thu, 4 Mar 2010 23:37:40 +0000 (18:37 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 4 Mar 2010 23:37:40 +0000 (18:37 -0500)
From http://archives.seul.org/tor/relays/Mar-2010/msg00006.html :

   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.

ChangeLog
src/or/config.c

index 7b64d582bab6cb8c18292436556326b1845265cd..d98b262821b514d630bcb906ed1e206145fd4780 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@ Changes in version 0.2.1.25 - 2010-??-??
     - When freeing a cipher, zero it out completely. We only zeroed
       the first ptrsize bytes. Bugfix on tor-0.0.2pre8. Discovered
       and patched by ekir. Fixes bug 1254.
+    - Avoid a bug that set IPs incorrectly on relays that did't set
+      Address to an IP address, when that address fails to resolve.
+      Fixes bug 1269.
+
   o Minor bugfixes:
     - Fix a dereference-then-NULL-check sequence when publishing
       descriptors. Bugfix on tor-0.2.1.5-alpha. Discovered by ekir,
index c7c1e19bcb7080d94476d13b83479ca81d5024f0..26e42e700912a9a8c932c3db277b2ed59866c926 100644 (file)
@@ -2367,7 +2367,7 @@ resolve_my_address(int warn_severity, or_options_t *options,
   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)) {
       uint32_t interface_ip;
 
       if (explicit_hostname) {