diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-11-05 13:26:29 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-14 23:16:25 -0500 |
commit | 2889bd2642ada3a2aa55fa4909825dfb7e90812e (patch) | |
tree | 82321c86f51feffd3b6d8cec3902e6a24ad92237 /src/or/connection_edge.h | |
parent | a58e17bcc308654b7e973debe88fe74ad817a2bb (diff) | |
download | tor-2889bd2642ada3a2aa55fa4909825dfb7e90812e.tar.gz tor-2889bd2642ada3a2aa55fa4909825dfb7e90812e.zip |
Revise the DNS subsystem to handle IPv6 exits.
Now, every cached_resolve_t can remember an IPv4 result *and* an IPv6
result. As a light protection against timing-based distinguishers for
IPv6 users (and against complexity!), every forward request generates
an IPv4 *and* an IPv6 request, assuming that we're an IPv6 exit. Once
we have answers or errors for both, we act accordingly.
This patch additionally makes some useful refactorings in the dns.c
code, though there is quite a bit more of useful refactoring that could
be done.
Additionally, have a new interface for the argument passed to the
evdns_callback function. Previously, it was just the original address
we were resolving. But it turns out that, on error, evdns doesn't
tell you the type of the query, so on a failure we didn't know whether
IPv4 or IPv6 queries were failing.
The new convention is to have the first byte of that argument include
the query type. I've refactored the code a bit to make that simpler.
Diffstat (limited to 'src/or/connection_edge.h')
-rw-r--r-- | src/or/connection_edge.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h index 354ab8f0b9..acfa52dfe5 100644 --- a/src/or/connection_edge.h +++ b/src/or/connection_edge.h @@ -91,12 +91,13 @@ int connection_edge_update_circuit_isolation(const entry_connection_t *conn, int dry_run); void circuit_clear_isolation(origin_circuit_t *circ); -#ifdef CONNECTION_EDGE_PRIVATE - +/* DOCDOC*/ #define BEGIN_FLAG_IPV6_OK (1u<<0) #define BEGIN_FLAG_IPV4_NOT_OK (1u<<1) #define BEGIN_FLAG_IPV6_PREFERRED (1u<<2) +#ifdef CONNECTION_EDGE_PRIVATE + /*DOCDOC*/ typedef struct begin_cell_t { char *address; |