mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
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.
This commit is contained in:
parent
053f2cb7c8
commit
d643487cc2
1 changed files with 5 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue