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
Fix truncation for UDP #1975
Fix truncation for UDP #1975
Conversation
a110ac2
to
d1b8126
Compare
@djc removed the use of MTU for now. I'm now using a combination of a larger constant as well as EDNS from the request. |
710cace
to
15498b9
Compare
@djc @bluejekyll I've expanded this to include a new integration test for truncation that was failing for UDP with large messages (as described in #1973) and added some changes that get it working. PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good. See my one question. I need to look over some of the other changes in detail. But I think this is looking good. Thanks for putting this together!
bc447c2
to
5bed981
Compare
This fixes a couple of issues for UDP on both the client and server: * Previously, the UdpClientStream was using a fixed `2048` for the size of the receive buffer. This can cause problems on interfaces with a larger MTU. hickory-dns#1096 adjusted this value on the server side to 4096 (the maximum as recommended by RFC6891). This PR sets a constant that is shared by the UDP client and server. Additionally, the client uses EDNS in the request to further trim down the buffer size. * The Server previously was not setting a maximum for the `BinEncoder`, which defaults to `u16::MAX` (i.e. effectively no truncation for UDP). This PR sets an appropriate maximum for the `BinEncoder` based on the response EDNS and protocol being used. Fixes: hickory-dns#1973
@djc @bluejekyll any ideas what's going on with the audit issue? I don't believe it's related to my PR. |
It's unrelated, just need an OpenSSL upgrade. |
@djc can this be force-merged? Or should we hold off until the openssl is upgraded? |
It can be force-merged, though only @bluejekyll currently has those privileges. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cleaning all of this up. looks good.
This fixes a couple of issues for UDP on both the client and server:
2048
for the size of the receive buffer. This can cause problems on interfaces with a larger MTU. PR 1096 adjusted this value on the server side to 4096 (the maximum as recommended by RFC6891). This PR sets a constant that is shared by the UDP client and server. Additionally, the client uses EDNS in the request to further trim down the buffer size.BinEncoder
, which defaults tou16::MAX
(i.e. effectively no truncation for UDP). This PR sets an appropriate maximum for theBinEncoder
based on the response EDNS and protocol being used.Fixes: #1973