aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-01-26 11:35:24 -0500
committerNick Mathewson <nickm@torproject.org>2011-01-26 11:35:24 -0500
commitd92a415bedd5220be05f3556007bf29ef18bd2f5 (patch)
tree960ce03bd56c5eaded80be93f01b2a74210e6e51 /src
parent411ec3c0f8cd4786233a3bc274cb2b766d4bfe7c (diff)
downloadtor-d92a415bedd5220be05f3556007bf29ef18bd2f5.tar.gz
tor-d92a415bedd5220be05f3556007bf29ef18bd2f5.zip
Add an option to disable the block-private-addresses feature
Suggested by rransom. Probably necessary for testing network mode.
Diffstat (limited to 'src')
-rw-r--r--src/or/config.c2
-rw-r--r--src/or/connection_edge.c3
-rw-r--r--src/or/or.h4
3 files changed, 8 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 8c1205de47..5aca2256ff 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -195,6 +195,7 @@ static config_var_t _option_vars[] = {
V(CircuitStreamTimeout, INTERVAL, "0"),
V(CircuitPriorityHalflife, DOUBLE, "-100.0"), /*negative:'Use default'*/
V(ClientDNSRejectInternalAddresses, BOOL,"1"),
+ V(ClientRejectInternalAddresses, BOOL, "1"),
V(ClientOnly, BOOL, "0"),
V(ConsensusParams, STRING, NULL),
V(ConnLimit, UINT, "1000"),
@@ -405,6 +406,7 @@ static config_var_t testing_tor_network_defaults[] = {
V(AuthDirMaxServersPerAddr, UINT, "0"),
V(AuthDirMaxServersPerAuthAddr,UINT, "0"),
V(ClientDNSRejectInternalAddresses, BOOL,"0"),
+ V(ClientRejectInternalAddresses, BOOL, "0"),
V(ExitPolicyRejectPrivate, BOOL, "0"),
V(V3AuthVotingInterval, INTERVAL, "5 minutes"),
V(V3AuthVoteDelay, INTERVAL, "20 seconds"),
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index a85943f69f..47e9035e90 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -1659,7 +1659,8 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL);
return -1;
}
- if (!conn->use_begindir && !conn->chosen_exit_name && !circ) {
+ if (options->ClientRejectInternalAddresses &&
+ !conn->use_begindir && !conn->chosen_exit_name && !circ) {
tor_addr_t addr;
if (tor_addr_from_str(&addr, socks->address) >= 0 &&
tor_addr_is_internal(&addr, 0)) {
diff --git a/src/or/or.h b/src/or/or.h
index a3ec71a927..752de219ef 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2756,6 +2756,10 @@ typedef struct {
* Helps avoid some cross-site attacks. */
int ClientDNSRejectInternalAddresses;
+ /** If true, do not accept any requests to connect to internal addresses
+ * over randomly chosen exits. */
+ int ClientRejectInternalAddresses;
+
/** The length of time that we think a consensus should be fresh. */
int V3AuthVotingInterval;
/** The length of time we think it will take to distribute votes. */