]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Finally fix the bug where dynamic-IP relays disappear when their
authorRoger Dingledine <arma@torproject.org>
Sat, 11 Apr 2009 18:09:15 +0000 (18:09 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 11 Apr 2009 18:09:15 +0000 (18:09 +0000)
IP address changes: directory mirrors were mistakenly telling them
their old address if they asked via begin_dir, so they never got
an accurate answer about their new address, so they just vanished
after a day. Should fix bugs 827, 883, and 900 -- but alas, only
after every directory mirror has upgraded.

svn:r19291

ChangeLog
src/or/connection_edge.c

index 8a008d3fa561eb5ce359436b5a355ca717592155..dc583de5f2aca622d4b90237ab41eacbd29f1622 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,21 +1,25 @@
 Changes in version 0.2.1.14-rc - 2009-04-11
-  o Security fixes:
-    - Avoid crashing in the presence of certain malformed descriptors.
-      Found by lark, and by automated fuzzing.
-
   o Major features:
     - Clients replace entry guards that were chosen more than a few months
       ago. This change should significantly improve client performance,
       especially once more people upgrade, since relays that have been
       a guard for a long time are currently overloaded.
 
-  o Major bugfixes:
+  o Major bugfixes (on 0.2.0):
+    - Finally fix the bug where dynamic-IP relays disappear when their
+      IP address changes: directory mirrors were mistakenly telling them
+      their old address if they asked via begin_dir, so they never got
+      an accurate answer about their new address, so they just vanished
+      after a day. Should fix bugs 827, 883, and 900 -- but alas, only
+      after every directory mirror has upgraded.
     - Relays were falling out of the networkstatus consensus for
       part of a day if they changed their local config but the
       authorities discarded their new descriptor as "not sufficiently
       different". Now directory authorities accept a descriptor as changed
       if bandwidthrate or bandwidthburst changed. Partial fix for bug 962;
       patch by Sebastian.
+    - Avoid crashing in the presence of certain malformed descriptors.
+      Found by lark, and by automated fuzzing.
 
   o Minor features:
     - When generating circuit events with verbose nicknames for
index b02282d8d47f52e0d57e21c897582b39f43bfab5..5ac37c1f4103d5c7c6c7bc108c1be3c7a63c4ca7 100644 (file)
@@ -2547,8 +2547,12 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
                                     END_STREAM_REASON_NOTDIRECTORY, NULL);
       return 0;
     }
-    if (or_circ && or_circ->p_conn && or_circ->p_conn->_base.address)
-      address = tor_strdup(or_circ->p_conn->_base.address);
+    /* Make sure to get the 'real' address of the previous hop: the
+     * caller might want to know whether his IP address has changed, and
+     * we might already have corrected _base.addr[ess] for the relay's
+     * canonical IP address. */
+    if (or_circ && or_circ->p_conn)
+      address = tor_dup_addr(&or_circ->p_conn->real_addr);
     else
       address = tor_strdup("127.0.0.1");
     port = 1; /* XXXX This value is never actually used anywhere, and there