Repository navigation
feat: add bounded DNS-over-TCP fallback - #4
Joshua Tenner (jtenner) wants to merge 5 commits into
Conversation
55dc5c1 to
11e133f
Compare
eddbfa6 to
5b5177f
Compare
fe6172d to
a600db5
Compare
5b5177f to
8b9c944
Compare
a600db5 to
ef37e84
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef37e843c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| if errors.Is(err, lneto.ErrTruncatedFrame) && tcpFallbackEnabled(n.config) { | ||
| query.beginTCPFallbackLocked() |
There was a problem hiding this comment.
Distinguish the TC flag from malformed-packet truncation errors
When TCP fallback is enabled, a UDP response with an incomplete question or resource record can start a private TCP connection even when its TC bit is clear. parseDNSResponseInto also returns ErrTruncatedFrame for those decoding failures; notably, validateDNSQuestions can return it before validating the question name/type/class. Consequently, this condition bypasses the documented requirement for a question-correlated response with TC set, retires the UDP lease, and consumes TCP resources for malformed input. Return a distinct fallback indication only after question validation and an explicit TC check, rather than treating every parser truncation error as permission to connect.
Useful? React with 👍 / 👎.
Stack status
agent/tls-full-gridfe6172deddbfa6Summary
Adds opt-in bounded DNS-over-TCP fallback without changing the six-function
wago_net_dnsABI or exposing raw TCP authority to guests.dns.EnableTCPFallback(maxResponseBytes, maxServiceAttempts)TEMPORARY_FAILUREunless the host opts intcp/register, binding, instance operations, ABI, namespace facet,net.tcp, andwago_net_tcpValidation
Passed locally and in hosted run
30186935628on the current head. Run30184217704passed the original functional head:go test ./...go test -shuffle=on -count=1 ./...go vet ./...internal/backend/lneto/dns, publicdns, and the root selective-composition matrix; current hosted CI completed all 123 supported packages in 48m04s18,176 B/op, 2 allocations before;1,792 B/op, 1 allocation after in the documented benchmark configuration)Explicitly incomplete
This does not add DNS-over-IPv6, DNS-over-TLS, DNS-over-HTTPS, DNSSEC validation, TCP connection pooling/reuse, raw TCP guest handles, or a portable TinyGo TLS implementation. One private TCP stream is used per fallback query and is closed deterministically.
2026-11-02 restack
Rebased onto PR #3 head
8b9c9445b08eb510788199d40285f9c971014505; current head isef37e843c8af97d7fc160136000eaf403609dddc. DNS-only composition uses the current Wago plugin loader while preserving private TCP fallback without exposing public TCP imports. Full ordinary, shuffle, vet, source-boundary, race, checkptr, backend-neutral 386,wagodebug,wago_regalloccheck, three-mode benchmark-compilation, and TLS signoff gates passed locally. The hosted plaintext failure was reproduced as a scheduler-sensitive test-harness condition inherited from PR #2; after the bounded-wait correction, the exact test passed 500 checkptr and 200 race repetitions on this head. July benchmark results remain historical; no benchmark timing was executed during this restack. Rewritten commits are unsigned because no desktop signing agent was available.