From f8f2586fb2528308f0b130c64cc7c13ca7820607 Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Tue, 10 Oct 2023 16:58:27 +0200 Subject: [PATCH] dns/dnsmessage: document that Skip does not fully validate the resource header --- dns/dnsmessage/message.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dns/dnsmessage/message.go b/dns/dnsmessage/message.go index b6b4f9c1..42987ab7 100644 --- a/dns/dnsmessage/message.go +++ b/dns/dnsmessage/message.go @@ -751,6 +751,9 @@ func (p *Parser) AllAnswers() ([]Resource, error) { } // SkipAnswer skips a single Answer Resource. +// +// It does not perform a complete validation of the resource header, which means +// it may return a nil error when the [AnswerHeader] would actually return an error. func (p *Parser) SkipAnswer() error { return p.skipResource(sectionAnswers) } @@ -801,6 +804,9 @@ func (p *Parser) AllAuthorities() ([]Resource, error) { } // SkipAuthority skips a single Authority Resource. +// +// It does not perform a complete validation of the resource header, which means +// it may return a nil error when the [AuthorityHeader] would actually return an error. func (p *Parser) SkipAuthority() error { return p.skipResource(sectionAuthorities) } @@ -851,6 +857,9 @@ func (p *Parser) AllAdditionals() ([]Resource, error) { } // SkipAdditional skips a single Additional Resource. +// +// It does not perform a complete validation of the resource header, which means +// it may return a nil error when the [AdditionalHeader] would actually return an error. func (p *Parser) SkipAdditional() error { return p.skipResource(sectionAdditionals) }