aboutsummaryrefslogtreecommitdiff
path: root/proposals/312-relay-auto-ipv6-addr.txt
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-02-05 10:55:04 +1000
committerteor <teor@torproject.org>2020-02-05 22:06:00 +1000
commit492549864e51fdc30195f1be467af6e463ba6fb2 (patch)
tree2fddd4ed4aa9fd4b97886a60c89598226f912a91 /proposals/312-relay-auto-ipv6-addr.txt
parent1f9f3986d188c9d530fd1edc7294978273796385 (diff)
downloadtorspec-492549864e51fdc30195f1be467af6e463ba6fb2.tar.gz
torspec-492549864e51fdc30195f1be467af6e463ba6fb2.zip
Prop 312: Add libevent DNS API
As suggested by Nick Mathewson. Part of 33073.
Diffstat (limited to 'proposals/312-relay-auto-ipv6-addr.txt')
-rw-r--r--proposals/312-relay-auto-ipv6-addr.txt32
1 files changed, 28 insertions, 4 deletions
diff --git a/proposals/312-relay-auto-ipv6-addr.txt b/proposals/312-relay-auto-ipv6-addr.txt
index 31a5dd7..ed5ebac 100644
--- a/proposals/312-relay-auto-ipv6-addr.txt
+++ b/proposals/312-relay-auto-ipv6-addr.txt
@@ -1070,7 +1070,7 @@ Ticket: #33073
method will find the IP address of the default route, in most cases
(see section 3.2.5).
-3.5.9. Add IPv6 Support Using gethostbyname2()
+3.5.9. Add IPv6 Support via Other DNS APIs
We propose these optional changes, to add IPv6 support to hostname
resolution on older OSes. These changes affect:
@@ -1082,8 +1082,14 @@ Ticket: #33073
Directory authorities do not use this address detection method to
discover their own addresses, for security reasons.
- Use gethostbyname2() to add IPv6 support to hostname resolution on older
- OSes, which don't support getaddrinfo().
+ Tor currently uses getaddrinfo() on most systems, which supports IPv6 DNS.
+ But tor also supports the legacy gethostbyname() DNS API, which does not
+ support IPv6.
+
+ There are two alternative APIs we could use for IPv6 DNS, if getaddrinfo()
+ is not available:
+ * libevent DNS API, and
+ * gethostbyname2().
But this change may be unnecessary, because:
* Linux has used getaddrinfo() by default since glibc 2.20 (2014)
@@ -1092,7 +1098,23 @@ Ticket: #33073
getaddrinfo() in a similar timeframe
* Windows has supported getaddrinfo() since Windows Vista; tor's minimum
supported Windows version is Vista.
- See [Tor Supported Platforms] for more details.
+ See [Tor Supported Platforms] for more detai
+
+ If a large number of systems do not support getaddrinfo(), we propose
+ implementing one of these alternatives:
+
+ The libevent DNS API supports IPv6 DNS, and tor already has a dependency on
+ libevent. Therefore, we should prefer the libevent DNS API. (Unless we find
+ it difficult to implement.)
+
+ We could also use gethostbyname2() to add IPv6 support to hostname
+ resolution on older OSes, which don't support getaddrinfo().
+
+ Handling multiple addresses:
+
+ When looking up hostnames using libevent, the DNS callbacks provide a list
+ of all addresses received. Therefore, we should ignore any private
+ addresses, and then choose the first address in the list.
When looking up hostnames using gethostbyname() or gethostbyname2(), if the
first address is a private address, we may want to look at the entire list
@@ -1105,6 +1127,8 @@ Ticket: #33073
(On OSes that support getaddrinfo(), tor searches the list of addresses for
a publicly routable address.)
+ Alternative change: remove gethostbyname():
+
As an alternative, if we believe that all supported OSes have getaddrinfo(),
we could simply remove the gethostbyname() code, rather than trying to
modify it to work with IPv6.