Support the zero length EDNS0 EXPIRE option (#1065)

* Support the zero length EDNS0 EXPIRE option

* EDNS0 EXPIRE: Just reference the RFC, don't link to it

Co-Authored-By: Miek Gieben <miek@miek.nl>

Co-authored-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Ask Bjørn Hansen 2019-12-30 05:42:48 -08:00 committed by Miek Gieben
parent ba5b1f0bae
commit e636c10380
1 changed files with 4 additions and 0 deletions

View File

@ -543,6 +543,10 @@ func (e *EDNS0_EXPIRE) pack() ([]byte, error) {
}
func (e *EDNS0_EXPIRE) unpack(b []byte) error {
if len(b) == 0 {
// zero-length EXPIRE query, see RFC 7314 Section 2
return nil
}
if len(b) < 4 {
return ErrBuf
}