OPT records don't have any class

This commit is contained in:
Frank Denis 2018-06-26 15:46:31 +02:00
parent 02888adff3
commit cc327fdc48
1 changed files with 2 additions and 2 deletions

View File

@ -119,7 +119,7 @@ func setMaxTTL(msg *dns.Msg, ttl uint32) {
}
for _, rr := range msg.Extra {
header := rr.Header()
if header.Class == dns.ClassINET && header.Rrtype == dns.TypeOPT {
if header.Rrtype == dns.TypeOPT {
continue
}
if ttl < rr.Header().Ttl {
@ -139,7 +139,7 @@ func updateTTL(msg *dns.Msg, expiration time.Time) {
}
for _, rr := range msg.Extra {
header := rr.Header()
if header.Class == dns.ClassINET && header.Rrtype == dns.TypeOPT {
if header.Rrtype == dns.TypeOPT {
continue
}
rr.Header().Ttl = ttl