summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-04-07 09:04:01 -0400
committerteor <teor@torproject.org>2020-04-09 11:05:32 +1000
commitcd2121a1262c2d51b8b9174933db5c985f0ccc55 (patch)
tree7022dc0ef8f529d141bd78480147c14e24fbdc8a /src/app
parent80a306c6e7d20efc44f2f93b559c44a52d952c39 (diff)
downloadtor-cd2121a1262c2d51b8b9174933db5c985f0ccc55.tar.gz
tor-cd2121a1262c2d51b8b9174933db5c985f0ccc55.zip
client: Revert setting PreferIPv6 on by default
This change broke torsocks that by default is expecting an IPv4 for hostname resolution because it can't ask tor for a specific IP version with the SOCKS5 extension. PreferIPv6 made it that sometimes the IPv6 could be returned to torsocks that was expecting an IPv4. Torsocks is probably a very unique case because the runtime flow is that it hijacks DNS resolution (ex: getaddrinfo()), gets an IP and then sends it back for the connect() to happen. The libc has DNS resolution functions that allows the caller to request a specific INET family but torsocks can't tell tor to resolve the hostname only to an IPv4 or IPv6 and thus by default fallsback to IPv4. Reverting this change into 0.4.3.x series but we'll keep it in the 0.4.4.x series in the hope that we add this SOCKS5 extension to tor for DNS resolution and then change torsocks to use that. Fixes #33804 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config/config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index bbf984ad08..c7ac9d6315 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -5886,7 +5886,7 @@ port_cfg_new(size_t namelen)
port_cfg_t *cfg = tor_malloc_zero(sizeof(port_cfg_t) + namelen + 1);
cfg->entry_cfg.ipv4_traffic = 1;
cfg->entry_cfg.ipv6_traffic = 1;
- cfg->entry_cfg.prefer_ipv6 = 1;
+ cfg->entry_cfg.prefer_ipv6 = 0;
cfg->entry_cfg.dns_request = 1;
cfg->entry_cfg.onion_traffic = 1;
cfg->entry_cfg.prefer_ipv6_virtaddr = 1;
@@ -6134,7 +6134,7 @@ port_parse_config(smartlist_t *out,
/* This must be kept in sync with port_cfg_new's defaults */
int no_listen = 0, no_advertise = 0, all_addrs = 0,
bind_ipv4_only = 0, bind_ipv6_only = 0,
- ipv4_traffic = 1, ipv6_traffic = 1, prefer_ipv6 = 1, dns_request = 1,
+ ipv4_traffic = 1, ipv6_traffic = 1, prefer_ipv6 = 0, dns_request = 1,
onion_traffic = 1,
cache_ipv4 = 0, use_cached_ipv4 = 0,
cache_ipv6 = 0, use_cached_ipv6 = 0,