Repository navigation
Conversation
Generated with OpenAI Codex
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #421 +/- ##
============================================
+ Coverage 66.95% 70.08% +3.13%
- Complexity 3098 3282 +184
============================================
Files 198 198
Lines 13709 13727 +18
Branches 2142 2145 +3
============================================
+ Hits 9179 9621 +442
+ Misses 3949 3527 -422
+ Partials 581 579 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
allenflux
marked this pull request as ready for review
October 16, 2026 14:34
|
ibauersachs
reviewed
Oct 24, 2026
|
|
||
| verifyTSIG(query, response, in); | ||
| if (!tcp && !ignoreTruncation && response.getHeader().getFlag(Flags.TC)) { | ||
| if (!tcp && !ignoreTruncation && (oversized || response.getHeader().getFlag(Flags.TC))) { |
Member
There was a problem hiding this comment.
If TSIG is in use, this check is never reached. So we can:
- Read everything we receive, regardless of what was specified in OPT. That would require growing the buffer on demand, we don't always want to allocate the max. message size.
- Keep it like this and accept TSIG validation failures (because the answer IS invalid)
- Retry with TCP regardless. Not really an option IMO, since this breaks the TSIG promise.
ibauersachs
reviewed
Oct 24, 2026
| Message response; | ||
| try { | ||
| response = parseMessage(in); | ||
| response = parseMessage(in, oversized); |
Member
There was a problem hiding this comment.
Instead of modifying Message, parse only the header if the message is oversized for the name/id/dclass validation, then retry with TCP. Fewer modifications and avoids useless parsing.
This branch has not been deployed
This file contains hidden or 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
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.



Fixes #418.
When a server returns a UDP response larger than the advertised payload size without setting TC, the receive buffer cuts it off and parsing fails before the resolver can retry over TCP. Read one additional byte, bounded by the DNS message limit, to distinguish an oversized response from a valid response that exactly fills the buffer. Parse an oversized response as truncated, then retain the existing ID, question, opcode and TSIG checks before using the TCP fallback.
ignoreTruncation=trueretains its existing receive and parsing behavior.Validation on macOS arm64 / OpenJDK 21.0.12.1:
mvn -B -ntp -Dgpg.skip -DexcludedGroups=concurrency verify: 1789 tests, 0 failures/errors, 28 skipped; compatibility, Spotless and Checkstyle checks pass. The concurrency exclusion and signing skip match the project's JDK 21 CI settings. The existing baseline suite reports 1781 tests with the same 28 skips.WireParseExceptionwithout attempting TCP. The small UDP and forced-TCP controls remain successful, and ignore-truncation does not retry.AI assistance: OpenAI Codex helped investigate, implement and validate this change.