aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/dns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-02-18 12:08:29 -0500
committerNick Mathewson <nickm@torproject.org>2020-02-18 12:08:29 -0500
commit1f06f494c8ce45946e565237a8a52785a8ece447 (patch)
treeb069175937c642fed7f300e157bdcc8446469ea5 /src/feature/relay/dns.c
parentdcbc45e6b2f80e8bd3664972d6317331d6b3bc85 (diff)
downloadtor-1f06f494c8ce45946e565237a8a52785a8ece447.tar.gz
tor-1f06f494c8ce45946e565237a8a52785a8ece447.zip
Move DNS TTL manipulation code to src/core/or
This removes a dependency from the client code on feature/relay.
Diffstat (limited to 'src/feature/relay/dns.c')
-rw-r--r--src/feature/relay/dns.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c
index 08fe4d39cf..5f4bddab9d 100644
--- a/src/feature/relay/dns.c
+++ b/src/feature/relay/dns.c
@@ -268,22 +268,6 @@ has_dns_init_failed(void)
return nameserver_config_failed;
}
-/** Helper: Given a TTL from a DNS response, determine what TTL to give the
- * OP that asked us to resolve it, and how long to cache that record
- * ourselves. */
-uint32_t
-clip_dns_ttl(uint32_t ttl)
-{
- /* This logic is a defense against "DefectTor" DNS-based traffic
- * confirmation attacks, as in https://nymity.ch/tor-dns/tor-dns.pdf .
- * We only give two values: a "low" value and a "high" value.
- */
- if (ttl < MIN_DNS_TTL)
- return MIN_DNS_TTL;
- else
- return MAX_DNS_TTL;
-}
-
/** Helper: free storage held by an entry in the DNS cache. */
static void
free_cached_resolve_(cached_resolve_t *r)