diff --git a/dnscrypt-proxy/dnsutils.go b/dnscrypt-proxy/dnsutils.go index e49db335..5cedaf18 100644 --- a/dnscrypt-proxy/dnsutils.go +++ b/dnscrypt-proxy/dnsutils.go @@ -90,12 +90,12 @@ func setMaxTTL(msg *dns.Msg, ttl uint32) { } } for _, rr := range msg.Ns { - if ttl < rr.Header().Ttl { + if ttl < rr.Header().Ttl { rr.Header().Ttl = ttl } } for _, rr := range msg.Extra { - if ttl < rr.Header().Ttl { + if ttl < rr.Header().Ttl { rr.Header().Ttl = ttl } } @@ -106,12 +106,12 @@ func updateTTL(msg *dns.Msg, expiration time.Time) { ttl := uint32(time.Until(expiration) / time.Second) for _, rr := range msg.Answer { - rr.Header().Ttl = ttl + rr.Header().Ttl = ttl } for _, rr := range msg.Ns { - rr.Header().Ttl = ttl + rr.Header().Ttl = ttl } for _, rr := range msg.Extra { - rr.Header().Ttl = ttl + rr.Header().Ttl = ttl } } diff --git a/dnscrypt-proxy/plugin_cache.go b/dnscrypt-proxy/plugin_cache.go index 7f34b46d..3c4f6b58 100644 --- a/dnscrypt-proxy/plugin_cache.go +++ b/dnscrypt-proxy/plugin_cache.go @@ -70,8 +70,8 @@ func (plugin *PluginCacheResponse) Eval(pluginsState *PluginsState, msg *dns.Msg } } plugin.cachedResponses.cache.Add(cacheKey, cachedResponse) - updateTTL(msg, cachedResponse.expiration) + return nil }