-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
msg.Len() disagrees with Pack() #453
Comments
Thanks for the test case. This is tricky to get right as |
Totally, this is why I posted a test case and didn't submit a PR :) |
Do you think you'll get around to this in the near future? If not I could have a look. |
This is the problem: https://github.com/miekg/dns/blob/master/msg.go#L994 Didn't want to use reflection at the time, but now that we "go gen" the packs and unpacks this needs to be generated as well. Although looking through the list, SRV is in there |
Can you make your example smaller? |
shows the problem as well. |
|
This is prolly also: skynetservices/skydns#313 |
#454 does not fix it, but is still good to have. |
Updated that PR which fixes the issue. Does that work/help you? |
I'll have a look asap - thanks for the fast turn-around |
I confirm that this PR fixes the issue for me. |
Fixed by #454 |
See hashicorp#3977 While trying to improve furthermore hashicorp#3948 (This pull request is still valid since we are not using Compression to compute the result anyway). I saw a strange behaviour of dns library. Basically, msg.Len() and len(msg.Pack()) disagree on Message len. Thus, calculation of DNS response is false consul relies on msg.Len() instead of the result of Pack() This is linked to miekg/dns#453 and a fix has been provided with miekg/dns#454 Would it be possible to upgrade miekg/dns to a more recent function ? Consul might for instance upgrade to a post 1.0 release such as https://github.com/miekg/dns/releases/tag/v1.0.4
See #3977 While trying to improve furthermore #3948 (This pull request is still valid since we are not using Compression to compute the result anyway). I saw a strange behaviour of dns library. Basically, msg.Len() and len(msg.Pack()) disagree on Message len. Thus, calculation of DNS response is false consul relies on msg.Len() instead of the result of Pack() This is linked to miekg/dns#453 and a fix has been provided with miekg/dns#454 Would it be possible to upgrade miekg/dns to a more recent function ? Consul might for instance upgrade to a post 1.0 release such as https://github.com/miekg/dns/releases/tag/v1.0.4
Here's a test that fails:
Results in
The text was updated successfully, but these errors were encountered: