GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Retry oversized UDP responses over TCP by allenflux · Pull Request #421 · dnsjava/dnsjava ConversationFixes #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. Validation on macOS arm64 / OpenJDK 21.0.12.1:
AI assistance: OpenAI Codex helped investigate, implement and validate this change.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsGenerated with OpenAI Codex
|
There was an error while loading. Please reload this page.
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:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| verifyTSIG(query, response, in); | ||
| if (!tcp && !ignoreTruncation && response.getHeader().getFlag(Flags.TC)) { | ||
| if (!tcp && !ignoreTruncation && (oversized || response.getHeader().getFlag(Flags.TC))) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If TSIG is in use, this check is never reached. So we can:
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Message response; | ||
| try { | ||
| response = parseMessage(in); | ||
| response = parseMessage(in, oversized); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
SimpleResolver: UDP response larger than the EDNS buffer fails with WireParseException instead of falling back to TCP
There was an error while loading. Please reload this page.