aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2009-04-11 18:09:15 +0000
committerRoger Dingledine <arma@torproject.org>2009-04-11 18:09:15 +0000
commit8d82583d9709938165172bedf5d6ac3cd7cd8942 (patch)
treed9d22f27d49e0b38af73e5e83012ed4368a38520 /src
parent235a1196b34a5680529299c4b5fa4e8583998a6f (diff)
downloadtor-8d82583d9709938165172bedf5d6ac3cd7cd8942.tar
tor-8d82583d9709938165172bedf5d6ac3cd7cd8942.tar.gz
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. svn:r19291
Diffstat (limited to 'src')
-rw-r--r--src/or/connection_edge.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index b02282d8d..5ac37c1f4 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -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