Merge branch 'pr1854_squashed' into maint-0.4.3

Squashed PR 1854, and fixed a minor typo (IPv4 -> IPv6).
This commit is contained in:
teor 2020-04-09 11:05:59 +10:00
commit f6efb3a184
No known key found for this signature in database
GPG Key ID: 10FEAA0E7075672A
4 changed files with 13 additions and 7 deletions

7
changes/ticket33804 Normal file
View File

@ -0,0 +1,7 @@
o Minor bugfixes (client, SocksPort, IPv6):
- Revert PreferIPv6 set by default on the SocksPort because it brokes the
torsocks use case. Tor doesn't have a way for an application to request
the hostname to be resolved for a specific IP version but torsocks
requires that. Up until now, IPv4 was used by default so it is expecting
that, and can't handle a possible IPv6 being returned. Fixes bug 33804;
bugfix on 0.4.3.1-alpha.

View File

@ -1492,10 +1492,9 @@ The following options are useful only for clients (that is, if
requests on this connection. This option is only relevant when SOCKS5 requests on this connection. This option is only relevant when SOCKS5
is in use, because SOCKS4 can't handle IPv6. (Allowing IPv6 is the is in use, because SOCKS4 can't handle IPv6. (Allowing IPv6 is the
default.) default.)
**NoPreferIPv6**;; **PreferIPv6**;;
Tells exits that, if a host has both an IPv4 and an IPv6 address, Tells exits that, if a host has both an IPv4 and an IPv6 address,
we would prefer to connect to it via IPv4. (IPv6 is the default in we would prefer to connect to it via IPv6. (IPv4 is the default.)
recent versions of Tor.)
**NoDNSRequest**;; **NoDNSRequest**;;
Do not ask exits to resolve DNS addresses in SOCKS5 requests. Tor will Do not ask exits to resolve DNS addresses in SOCKS5 requests. Tor will
connect to IPv4 addresses, IPv6 addresses (if IPv6Traffic is set) and connect to IPv4 addresses, IPv6 addresses (if IPv6Traffic is set) and
@ -1537,7 +1536,7 @@ The following options are useful only for clients (that is, if
When serving a hostname lookup request on this port that When serving a hostname lookup request on this port that
should get automapped (according to AutomapHostsOnResolve), should get automapped (according to AutomapHostsOnResolve),
if we could return either an IPv4 or an IPv6 answer, prefer if we could return either an IPv4 or an IPv6 answer, prefer
an IPv4 answer. (Tor prefers IPv6 by default.) an IPv4 answer. (Tor prefers IPv4 by default.)
**PreferSOCKSNoAuth**;; **PreferSOCKSNoAuth**;;
Ordinarily, when an application offers both "username/password Ordinarily, when an application offers both "username/password
authentication" and "no authentication" to Tor via SOCKS5, Tor authentication" and "no authentication" to Tor via SOCKS5, Tor

View File

@ -5886,7 +5886,7 @@ port_cfg_new(size_t namelen)
port_cfg_t *cfg = tor_malloc_zero(sizeof(port_cfg_t) + namelen + 1); port_cfg_t *cfg = tor_malloc_zero(sizeof(port_cfg_t) + namelen + 1);
cfg->entry_cfg.ipv4_traffic = 1; cfg->entry_cfg.ipv4_traffic = 1;
cfg->entry_cfg.ipv6_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.dns_request = 1;
cfg->entry_cfg.onion_traffic = 1; cfg->entry_cfg.onion_traffic = 1;
cfg->entry_cfg.prefer_ipv6_virtaddr = 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 */ /* This must be kept in sync with port_cfg_new's defaults */
int no_listen = 0, no_advertise = 0, all_addrs = 0, int no_listen = 0, no_advertise = 0, all_addrs = 0,
bind_ipv4_only = 0, bind_ipv6_only = 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, onion_traffic = 1,
cache_ipv4 = 0, use_cached_ipv4 = 0, cache_ipv4 = 0, use_cached_ipv4 = 0,
cache_ipv6 = 0, use_cached_ipv6 = 0, cache_ipv6 = 0, use_cached_ipv6 = 0,

View File

@ -4159,7 +4159,7 @@ test_config_parse_port_config__ports__ports_given(void *data)
tt_int_op(port_cfg->entry_cfg.dns_request, OP_EQ, 1); tt_int_op(port_cfg->entry_cfg.dns_request, OP_EQ, 1);
tt_int_op(port_cfg->entry_cfg.ipv4_traffic, OP_EQ, 1); tt_int_op(port_cfg->entry_cfg.ipv4_traffic, OP_EQ, 1);
tt_int_op(port_cfg->entry_cfg.ipv6_traffic, OP_EQ, 1); tt_int_op(port_cfg->entry_cfg.ipv6_traffic, OP_EQ, 1);
tt_int_op(port_cfg->entry_cfg.prefer_ipv6, OP_EQ, 1); tt_int_op(port_cfg->entry_cfg.prefer_ipv6, OP_EQ, 0);
tt_int_op(port_cfg->entry_cfg.onion_traffic, OP_EQ, 1); tt_int_op(port_cfg->entry_cfg.onion_traffic, OP_EQ, 1);
tt_int_op(port_cfg->entry_cfg.cache_ipv4_answers, OP_EQ, 0); tt_int_op(port_cfg->entry_cfg.cache_ipv4_answers, OP_EQ, 0);
tt_int_op(port_cfg->entry_cfg.prefer_ipv6_virtaddr, OP_EQ, 1); tt_int_op(port_cfg->entry_cfg.prefer_ipv6_virtaddr, OP_EQ, 1);