commit d643487cc24c9f8d7c56cdf961a1e5598339538c Author: Nick Mathewson nickm@torproject.org Date: Wed Nov 14 22:29:08 2012 -0500
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. --- src/or/dnsserv.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/or/dnsserv.c b/src/or/dnsserv.c index f5d430b..a211899 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,
tor-commits@lists.torproject.org