From 97f604670c6fa249107810c05c8bc115fe26cd5e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 26 Jun 2018 08:24:13 +0200 Subject: [PATCH] Don't update OPT records Fixes #527 --- dnscrypt-proxy/dnsutils.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dnscrypt-proxy/dnsutils.go b/dnscrypt-proxy/dnsutils.go index 098770c1..645fe93a 100644 --- a/dnscrypt-proxy/dnsutils.go +++ b/dnscrypt-proxy/dnsutils.go @@ -118,6 +118,10 @@ func setMaxTTL(msg *dns.Msg, ttl uint32) { } } for _, rr := range msg.Extra { + header := rr.Header() + if header.Class == dns.ClassINET && header.Rrtype == dns.TypeOPT { + continue + } if ttl < rr.Header().Ttl { rr.Header().Ttl = ttl } @@ -134,6 +138,10 @@ func updateTTL(msg *dns.Msg, expiration time.Time) { rr.Header().Ttl = ttl } for _, rr := range msg.Extra { + header := rr.Header() + if header.Class == dns.ClassINET && header.Rrtype == dns.TypeOPT { + continue + } rr.Header().Ttl = ttl } }