aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-02-11 05:31:56 +0000
committerRoger Dingledine <arma@torproject.org>2008-02-11 05:31:56 +0000
commit28483467d02ea0002fbceb8c5f5479972f1803fe (patch)
treeff44094e85e824bbad8910a47952666d70e807ae /src/or/directory.c
parentbc4d6515fc9819a6dd9729797e6e1006ce5dd5ce (diff)
downloadtor-28483467d02ea0002fbceb8c5f5479972f1803fe.tar.gz
tor-28483467d02ea0002fbceb8c5f5479972f1803fe.zip
Directory mirrors no longer include a guess at the client's IP
address if the connection appears to be coming from the same /24 network; it was producing too many wrong guesses. svn:r13464
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 9dd1a81050..3eee6fa1cf 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1984,8 +1984,10 @@ write_http_response_header_impl(dir_connection_t *conn, ssize_t length,
tor_snprintf(cp, sizeof(tmp)-(cp-tmp), "Content-Type: %s\r\n", type);
cp += strlen(cp);
}
- if (!is_internal_IP(conn->_base.addr, 0)) {
- /* Don't report the source address for a localhost/private connection. */
+ if (!is_local_IP(conn->_base.addr)) {
+ /* Don't report the source address for a nearby/private connection.
+ * Otherwise we tend to mis-report in cases where incoming ports are
+ * being forwarded to a Tor server running behind the firewall. */
tor_snprintf(cp, sizeof(tmp)-(cp-tmp),
X_ADDRESS_HEADER "%s\r\n", conn->_base.address);
cp += strlen(cp);