update to latest adns with fix for endless loop for incoming corrupt packets

This commit is contained in:
Mechiel Lukkien
2024-05-09 11:30:42 +02:00
parent 09ee89d5c8
commit 98ce133203
4 changed files with 10 additions and 6 deletions

View File

@ -262,7 +262,9 @@ func checkHeader(p *dnsmessage.Parser, h dnsmessage.Header) error {
return errServerTemporarilyMisbehaving
}
if rh.Type != dnsmessage.TypeOPT {
p.SkipAdditional()
if err := p.SkipAdditional(); err != nil {
return errInvalidDNSResponse
}
continue
}
// Only one OPT record is allowed. With multiple we MUST return an error. See RFC
@ -328,7 +330,9 @@ func extractExtendedRCode(p dnsmessage.Parser, hdr dnsmessage.Header) (dnsmessag
if ahdr.Type == dnsmessage.TypeOPT {
return ahdr.ExtendedRCode(hdr.RCode), hasAdd
}
p.SkipAdditional()
if err := p.SkipAdditional(); err != nil {
return hdr.RCode, hasAdd
}
}
}

2
vendor/modules.txt vendored
View File

@ -7,7 +7,7 @@ github.com/cespare/xxhash/v2
# github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
## explicit; go 1.19
github.com/matttproud/golang_protobuf_extensions/v2/pbutil
# github.com/mjl-/adns v0.0.0-20240309142737-2a1aacf346dc
# github.com/mjl-/adns v0.0.0-20240509092456-2dc8715bf4af
## explicit; go 1.20
github.com/mjl-/adns
github.com/mjl-/adns/internal/bytealg