diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-11-14 10:09:06 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-14 23:16:40 -0500 |
commit | 363cf024553741524c0c8cb9fa8b9226863c903b (patch) | |
tree | a5b2e300eafa5e01f5e17752c1d19f8425dea278 /src/or/connection_edge.c | |
parent | c4830bfbe2db333b6550d8b3e98868fa2c808b76 (diff) | |
download | tor-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.c | 7 |
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 " |