summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Winter <phw@nymity.ch>2016-07-27 12:01:03 -0400
committerNick Mathewson <nickm@torproject.org>2017-01-18 08:57:09 -0500
commiteae68fa2d2bde931bf8b9115f7a9cb7a0f0c9073 (patch)
tree18b2bae63888dbfe26d9913f42aa1795f6d81cb0
parenta969ae8e2135c5411537b14bcab310341260ef32 (diff)
downloadtor-eae68fa2d2bde931bf8b9115f7a9cb7a0f0c9073.tar.gz
tor-eae68fa2d2bde931bf8b9115f7a9cb7a0f0c9073.zip
Initialise DNS TTL for A and AAAA records.
So far, the TTLs for both A and AAAA records were not initialised, resulting in exit relays sending back the value 60 to Tor clients. This also impacts exit relays' DNS cache -- the expiry time for all domains is set to 60. This fixes <https://bugs.torproject.org/19025>.
-rw-r--r--src/or/dns.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index 41a6dfd0a4..e007a402f4 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -326,7 +326,7 @@ cached_resolve_add_answer(cached_resolve_t *resolve,
resolve->result_ipv4.err_ipv4 = dns_result;
resolve->res_status_ipv4 = RES_STATUS_DONE_ERR;
}
-
+ resolve->ttl_ipv4 = ttl;
} else if (query_type == DNS_IPv6_AAAA) {
if (resolve->res_status_ipv6 != RES_STATUS_INFLIGHT)
return;
@@ -341,6 +341,7 @@ cached_resolve_add_answer(cached_resolve_t *resolve,
resolve->result_ipv6.err_ipv6 = dns_result;
resolve->res_status_ipv6 = RES_STATUS_DONE_ERR;
}
+ resolve->ttl_ipv6 = ttl;
}
}