summaryrefslogtreecommitdiff
path: root/src/or/dnsserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-11-14 22:29:08 -0500
committerNick Mathewson <nickm@torproject.org>2012-11-14 23:16:58 -0500
commitd643487cc24c9f8d7c56cdf961a1e5598339538c (patch)
tree2f649f99126f65eefeddd4f8b60f2d786dda741d /src/or/dnsserv.c
parent053f2cb7c89a4f6b52fa601f83f798d45ab8eca4 (diff)
downloadtor-d643487cc24c9f8d7c56cdf961a1e5598339538c.tar.gz
tor-d643487cc24c9f8d7c56cdf961a1e5598339538c.zip
Initial support for AAAA requests on DNSPort.
This is imperfect, since it sends back whatever we would send to a socks RESOLVE request, when in reality we should send back whatever was asked for.
Diffstat (limited to 'src/or/dnsserv.c')
-rw-r--r--src/or/dnsserv.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/dnsserv.c b/src/or/dnsserv.c
index f5d430bf38..a211899073 100644
--- a/src/or/dnsserv.c
+++ b/src/or/dnsserv.c
@@ -102,7 +102,7 @@ evdns_server_callback(struct evdns_server_request *req, void *data_)
evdns_server_request_respond(req, DNS_ERR_NOTIMPL);
return;
}
- if (q->type != EVDNS_TYPE_A) {
+ if (q->type != EVDNS_TYPE_A && q->type != EVDNS_TYPE_AAAA) {
tor_assert(q->type == EVDNS_TYPE_PTR);
}
@@ -126,7 +126,7 @@ evdns_server_callback(struct evdns_server_request *req, void *data_)
TO_CONN(conn)->port = port;
TO_CONN(conn)->address = tor_dup_addr(&tor_addr);
- if (q->type == EVDNS_TYPE_A)
+ if (q->type == EVDNS_TYPE_A || q->type == EVDNS_TYPE_AAAA)
entry_conn->socks_request->command = SOCKS_COMMAND_RESOLVE;
else
entry_conn->socks_request->command = SOCKS_COMMAND_RESOLVE_PTR;
@@ -290,8 +290,9 @@ dnsserv_resolved(entry_connection_t *conn,
* or more of the questions in the request); then, call
* evdns_server_request_respond. */
if (answer_type == RESOLVED_TYPE_IPV6) {
- log_info(LD_APP, "Got an IPv6 answer; that's not implemented.");
- err = DNS_ERR_NOTIMPL;
+ evdns_server_request_add_aaaa_reply(req,
+ name,
+ 1, answer, ttl);
} else if (answer_type == RESOLVED_TYPE_IPV4 && answer_len == 4 &&
conn->socks_request->command == SOCKS_COMMAND_RESOLVE) {
evdns_server_request_add_a_reply(req,