-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/dns/dnsmessage: use UnknownResource for an unrecognized DNS type #42128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
LGTM |
The type ResourceHeader struct {
...
// Type is the type of DNS resource record.
//
// This field will be set automatically during packing.
Type Type
...
} It should also be possible to add an This is definitely a good addition though, miekg/dns (of which I contribute) has similar support for unknown RRs with a type RFC3597 struct that can be both packed and unpacked. |
Thanks, Tom! I've switched the Here's the diff for those changes: https://go-review.googlesource.com/c/net/+/262037/6..8 |
It's been brought to my attention that this design might be a compatibility issue when adding support for new RR types. Rather than adding an Suppose a user of this API wants to support a new RR type, such as draft-ietf-dnsop-svcb-https-01. If the caller relies on If their code instead branched on |
In my opinion, code that relies on |
Adding to minutes but it seems headed for likely accept. |
Based on the discussion, this seems like a likely accept. |
No change in consensus, so accepted. |
I'm surprised this issue didn't get auto-closed yesterday when the change landed: golang/net@cd0ac97. |
Whoops, the line in the CL should have been |
This is a proposal for the already written https://golang.org/cl/262037. The proposal is to change methods like
(*Parser).Answer
and(*Parser).Additional
such that when they see a resource that is not specifically recognized by the package, then rather than return an error, they return aResource
of typeUnknownResource
.Filing a proposal as this is new API.
CC @iangudger
The text was updated successfully, but these errors were encountered: