-
Notifications
You must be signed in to change notification settings - Fork 594
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: correctly handle dns messages in our dns implementation #8768
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frezbo
approved these changes
May 20, 2024
I wonder if we can add some tests too |
DmitriyMV
force-pushed
the
dns-buffer-size
branch
from
May 20, 2024 17:38
75c0539
to
3bf5007
Compare
Tests are incoming. |
smira
reviewed
May 20, 2024
internal/app/machined/pkg/controllers/k8s/templates/core-dns-template.yaml
Outdated
Show resolved
Hide resolved
DmitriyMV
force-pushed
the
dns-buffer-size
branch
3 times, most recently
from
May 23, 2024 17:34
d4b4344
to
ba5ef97
Compare
smira
reviewed
May 23, 2024
DmitriyMV
force-pushed
the
dns-buffer-size
branch
2 times, most recently
from
May 23, 2024 18:33
2f70c1c
to
c4cd2e7
Compare
frezbo
approved these changes
May 23, 2024
smira
approved these changes
May 23, 2024
DmitriyMV
force-pushed
the
dns-buffer-size
branch
from
May 24, 2024 13:02
c4cd2e7
to
ab5b628
Compare
- By default, github.com/miekg/dns uses `dns.MinMsgSize` for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size to `dns.DefaultMsgSize` 4096 bytes, which is the maximum size of a dns packet payload per RFC 6891. - We also retry the request if the response is truncated or previous connection was closed. - And finally we properly handle the case where the response is larger than the client buffer size, and we return a truncated correct response. Closes siderolabs#8763 Signed-off-by: Dmitriy Matrenichev <[email protected]>
DmitriyMV
force-pushed
the
dns-buffer-size
branch
from
May 24, 2024 18:41
ab5b628
to
a9cf9b7
Compare
/m |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
dns.MinMsgSize
for UDP messages, which is 512 bytes. This is too small for some DNS request/responses, and can cause truncation and errors. This change sets the buffer size todns.DefaultMsgSize
4096 bytes, which is the maximum size of a dns packet payload per RFC 6891.
and we return a truncated correct response.
Closes #8763