aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-11-14 10:09:06 -0500
committerNick Mathewson <nickm@torproject.org>2012-11-14 23:16:40 -0500
commit363cf024553741524c0c8cb9fa8b9226863c903b (patch)
treea5b2e300eafa5e01f5e17752c1d19f8425dea278 /src/or/connection_edge.c
parentc4830bfbe2db333b6550d8b3e98868fa2c808b76 (diff)
downloadtor-363cf024553741524c0c8cb9fa8b9226863c903b.tar.gz
tor-363cf024553741524c0c8cb9fa8b9226863c903b.zip
Implement a PreferIPv6 flag for SocksPorts
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 758d8f5d87..4f3dda2842 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -1682,6 +1682,13 @@ connection_ap_get_begincell_flags(entry_connection_t *ap_conn)
}
}
+ if (flags == BEGIN_FLAG_IPV6_OK) {
+ /* When IPv4 and IPv6 are both allowed, consider whether to say we
+ * prefer IPv6. Otherwise there's no point in declaring a preference */
+ if (ap_conn->prefer_ipv6_traffic)
+ flags |= BEGIN_FLAG_IPV6_PREFERRED;
+ }
+
if (flags == BEGIN_FLAG_IPV4_NOT_OK) {
log_warn(LD_BUG, "Hey; I'm about to ask a node for a connection that I "
"am telling it to fulfil with neither IPv4 nor IPv6. That's "