Skip to content

Validate DTLS 1.2 datagram order and back off flight resends - #169

Merged
algesten merged 4 commits into
mainfrom
fix-dtls12-datagram-order-backoff
Oct 3, 2026
Merged

algesten merged 4 commits into
mainfrom
fix-dtls12-datagram-order-backoff

Conversation

@algesten

@algesten algesten commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Summary

Discard DTLS 1.2 datagrams whose handshake message_seq values decrease before classifying or queueing records. Equal sequences remain valid for fragments, and datagrams can arrive out of order. Validate CCS/epoch ordering before peer encryption starts.

Keep the first duplicate-triggered flight resend immediate, then suppress further duplicate responses during exponential backoff. Restart the flight timer after early resends and retain a cooldown for final-flight replies after periodic retransmission stops.

Add regressions for successful clean retransmission after a scrambled datagram is discarded, reordering across datagrams, fragment sequence repeats, and resend cooldown behavior.

@algesten

algesten commented Oct 2, 2026

Copy link
Copy Markdown
Owner Author

Review-cycle round 1: no actionable findings against the complete PR at 768b0bc4025cbf2547f07150e51683714109261c.

Reviewed datagram validation before classification/queueing, repeated fragment sequences, ordering across datagrams, pooled-buffer cleanup, flight timer restart, duplicate cooldown expiry/reset, and final-flight recovery after periodic retransmission stops. The proposed scope remains limited to DTLS 1.2.

Validation passed:

  • CARGO_TARGET_DIR=/Users/martin/dev/dimpl/target cargo test --offline --quiet — 593 passed, 2 ignored.
  • CARGO_TARGET_DIR=/Users/martin/dev/dimpl/target cargo test --offline --no-default-features --features rust-crypto --quiet --lib dtls12:: — 97 passed; existing unrelated test warnings remain.
  • cargo fmt --all -- --check
  • CARGO_TARGET_DIR=/Users/martin/dev/dimpl/target cargo clippy --offline -- -D warnings

No regression-test commit was needed. Both the PR worktree and the main checkout remain clean.

@algesten
algesten merged commit 38a3740 into main Oct 3, 2026
46 checks passed
@algesten
algesten deleted the fix-dtls12-datagram-order-backoff branch October 3, 2026 06:36
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