diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-02-20 20:04:01 +1100 |
---|---|---|
committer | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-02-20 23:40:37 +1100 |
commit | c281c0365482891d6c3e71f85b2a6615faa5990b (patch) | |
tree | c18111633dc6aabfb73226fb3aeda858a32b0b15 /src/or/connection.c | |
parent | 4afb107278f528b9002415709d7a0003106ff70c (diff) | |
download | tor-c281c0365482891d6c3e71f85b2a6615faa5990b.tar.gz tor-c281c0365482891d6c3e71f85b2a6615faa5990b.zip |
If both IPv4 and IPv6 addresses could be used, choose one correctly
If there is a node, use node_ipv6_or/dir_preferred().
If there is no node, use fascist_firewall_prefer_ipv6_or/dirport().
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index a1e9850dc0..0f2b3e356e 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1763,6 +1763,13 @@ connection_connect_log_client_use_ip_version(const connection_t *conn) log_backtrace(LOG_WARN, LD_BUG, "Address came from"); } + /* Bridges are allowed to break IPv4/IPv6 ORPort preferences to connect to + * the node's configured address when ClientPreferIPv6ORPort is auto */ + if (options->UseBridges && conn->type == CONN_TYPE_OR + && options->ClientPreferIPv6ORPort == -1) { + return; + } + /* Check if we couldn't satisfy an address family preference */ if ((!pref_ipv6 && tor_addr_family(&real_addr) == AF_INET6) || (pref_ipv6 && tor_addr_family(&real_addr) == AF_INET)) { |