aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/policies.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-03-09 09:33:05 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-03-09 09:33:05 -0400
commit6684c6e17fd6e038159dd2ca63416cdcd7a12270 (patch)
tree618b9da6336fe47dcaf21591e6b49bdd1051ba4b /src/core/or/policies.c
parent8096f3b2549971e120fa3869ea9e458fdad313d5 (diff)
parent7d673e70b072663e3f9f11819b166846e578251d (diff)
downloadtor-6684c6e17fd6e038159dd2ca63416cdcd7a12270.tar.gz
tor-6684c6e17fd6e038159dd2ca63416cdcd7a12270.zip
Merge branch 'tor-github/pr/1751'
Diffstat (limited to 'src/core/or/policies.c')
-rw-r--r--src/core/or/policies.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/core/or/policies.c b/src/core/or/policies.c
index 4ac598fce3..dd4feaadfc 100644
--- a/src/core/or/policies.c
+++ b/src/core/or/policies.c
@@ -463,8 +463,7 @@ fascist_firewall_use_ipv6(const or_options_t *options)
* ClientPreferIPv6DirPort is deprecated, but check it anyway. */
return (options->ClientUseIPv6 == 1 || options->ClientUseIPv4 == 0 ||
options->ClientPreferIPv6ORPort == 1 ||
- options->ClientPreferIPv6DirPort == 1 || options->UseBridges == 1 ||
- options->ClientAutoIPv6ORPort == 1);
+ options->ClientPreferIPv6DirPort == 1 || options->UseBridges == 1);
}
/** Do we prefer to connect to IPv6, ignoring ClientPreferIPv6ORPort and
@@ -491,15 +490,6 @@ fascist_firewall_prefer_ipv6_impl(const or_options_t *options)
return -1;
}
-/* Choose whether we prefer IPv4 or IPv6 by randomly choosing an address
- * family. Return 0 for IPv4, and 1 for IPv6. */
-MOCK_IMPL(int,
-fascist_firewall_rand_prefer_ipv6_addr, (void))
-{
- /* TODO: Check for failures, and infer our preference based on this. */
- return crypto_rand_int(2);
-}
-
/** Do we prefer to connect to IPv6 ORPorts?
* Use node_ipv6_or_preferred() whenever possible: it supports bridge client
* per-node IPv6 preferences.
@@ -514,10 +504,7 @@ fascist_firewall_prefer_ipv6_orport(const or_options_t *options)
}
/* We can use both IPv4 and IPv6 - which do we prefer? */
- if (options->ClientAutoIPv6ORPort == 1) {
- /* If ClientAutoIPv6ORPort is 1, we prefer IPv4 or IPv6 at random. */
- return fascist_firewall_rand_prefer_ipv6_addr();
- } else if (options->ClientPreferIPv6ORPort == 1) {
+ if (options->ClientPreferIPv6ORPort == 1) {
return 1;
}