Skip to content

Fix DNS/DoH beacon reliability: prevent task loss and improve data exchange#321

Open
shashinma wants to merge 4 commits intoAdaptix-Framework:dev-v1.3from
shashinma:dev-v1.3-fix-dns/doh
Open

Fix DNS/DoH beacon reliability: prevent task loss and improve data exchange#321
shashinma wants to merge 4 commits intoAdaptix-Framework:dev-v1.3from
shashinma:dev-v1.3-fix-dns/doh

Conversation

@shashinma
Copy link
Copy Markdown
Contributor

Summary

  • Fix DNS beacon profile generation that was silently dropping common fields (sleep, jitter, killdate) by appending DNS-specific params to the existing slice instead of creating a new one
  • Fix critical task loss bug where upDoneCache (upload deduplication cache) falsely marked new task results as already processed when their size matched a previous upload — now cleared on every new upload (offset == 0)
  • Fix agent-side reliability: use A query type for PUT ACK instead of TXT, keep burst mode active until ACK is delivered via IsBusy(), remove premature hasPendingTasks resets on transient network failures
  • Improve inflight retry: expired download buffers are transferred to localInflights for redelivery instead of being dropped; inflights reset on timeout (infinite retry) instead of being deleted after N attempts
  • Upgrade Go to 1.26.1 in Dockerfile and install script

Changes

File Description
Dockerfile, pre_install_linux_all.sh Go 1.25 -> 1.26.1
beacon_agent/pl_main.go, pl_utils.go Pass existing params into buildDNSProfileParams instead of creating a new slice
beacon_agent/.../ConnectorDNS.cpp PUT via A query, IsBusy includes downAckOffset, removed false hasPendingTasks resets
beacon_agent/.../ConnectorDNS.h kMaxSafeFrame 60 -> 110
beacon_listener_dns/pl_transport.go Fix upDoneCache dedup, accept ACK with nonce==0, inflight infinite retry, stricter encrypt_key validation, dnsSafeChunkSize 280 -> 480

Append DNS-specific params to existing common params instead of
creating a new slice, preventing loss of sleep/jitter/killdate fields.
- Use A query type for PUT to fix TXT ACK parsing failures
- Include downAckOffset in IsBusy() to stay in burst mode until ACK delivered
- Remove premature hasPendingTasks resets on transient failures
- Reset downAckOffset/downTaskNonce on "no data" GET response
- Increase kMaxSafeFrame to 110, use lightweight inter-fragment pacing
… retry

- Clear upDoneCache on new upload (offset==0) to prevent false dedup
- Accept ackTaskNonce==0 for backward-compatible ACK delivery
- Clean up localInflights on completed GET downloads
- Transfer expired downFrags to localInflights for retry instead of dropping
- Reset inflight attempts on timeout instead of deleting (indefinite retry)
- Stricter encrypt_key validation (exactly 32 hex chars)
- Increase dnsSafeChunkSize to 480, reduce cleanup/inflight intervals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant