diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app/config/config.c | 3 | ||||
-rw-r--r-- | src/core/mainloop/connection.c | 2 | ||||
-rw-r--r-- | src/test/test_config.c | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index bc65977b20..bbf984ad08 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -5886,6 +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.dns_request = 1; cfg->entry_cfg.onion_traffic = 1; cfg->entry_cfg.prefer_ipv6_virtaddr = 1; @@ -6133,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 = 0, dns_request = 1, + ipv4_traffic = 1, ipv6_traffic = 1, prefer_ipv6 = 1, dns_request = 1, onion_traffic = 1, cache_ipv4 = 0, use_cached_ipv4 = 0, cache_ipv6 = 0, use_cached_ipv6 = 0, diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index f0ebce9bbb..223428a8f6 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -1516,7 +1516,7 @@ connection_listener_new(const struct sockaddr *listensockaddr, if (type != CONN_TYPE_AP_LISTENER) { lis_conn->entry_cfg.ipv4_traffic = 1; lis_conn->entry_cfg.ipv6_traffic = 1; - lis_conn->entry_cfg.prefer_ipv6 = 0; + lis_conn->entry_cfg.prefer_ipv6 = 1; } if (connection_add(conn) < 0) { /* no space, forget it */ diff --git a/src/test/test_config.c b/src/test/test_config.c index 9e14e2e25a..ee277104fb 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -4158,6 +4158,8 @@ test_config_parse_port_config__ports__ports_given(void *data) /* Test entry port defaults as initialised in port_parse_config */ 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.ipv6_traffic, OP_EQ, 1); + tt_int_op(port_cfg->entry_cfg.prefer_ipv6, 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.prefer_ipv6_virtaddr, OP_EQ, 1); |