-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/net/dns/dnsmessage: cannot parse mDNS SRV records #24870
Comments
For the incremental Parser/Builder, we can add additional methods to handle the MDNS SRV fields which I guess the user can use depending on which type of SRV record they expect. Does that sound ok? I am not sure what we can do for the more automated Pack/Unpack interface. I guess we revert the change just to Unpack to maximize correctness and add a comment. We could also explicitly only allow parsing MDNS SRV records with the incremental interface. Thoughts? |
Just thinking through the options out loud.. Unicast DNS
Multicast DNS
Hence, Message.Pack can't properly support both Unicast/Multicast. It is better to not compress the target field to meet unicast DNS requirement. Also, not compressing the target field is compatible with multicast DNS. For Message.Unpack, the caller probably won't be able to determine whether result is corrupt or not for unicast DNS. I guess it is probably better to flag the error? This means Unpack can't be used for multicast, but it shouldn't be used for packing multicast either. I'd recommend:
|
After looking a bit more at the RFC, I have another idea. What if we add new MulticastPack and MulticastUnpack methods to Message? It appears that the message is either multicast or unicast and that the user should know which one it is. |
As described in RFC 8222, there's no good way to operate unicast DNS and multicast DNS seamlessly from DNS message handling to DNS label handling. Probably it's better to provide separated APIs for now. |
Also RFC 3597 permits use of DNS compression in SRV:
|
DNS message compression was disabled SRV Target fields in #10622 / https://golang.org/cl/100055 (as per RFC 2782).
However, compression is explicitly allowed for the MDNS SRV target field (RFC 6762 Sec 18.14):
Attempting to decode a Chromecast MDNS SRV record with
dnsmessage.Message.Unpack
now fails with the error:Compression support for DNS SRV target fields is necessary to support MDNS. Please consider:
Cc @mdempsky @iangudger
The text was updated successfully, but these errors were encountered: