Listener tests cover zone-transfer rate limiting over TLS and QUIC and the RA pending-reply cap #308

Merged
claude merged 5 commits from feature/55-listener-rate-limit-tests into develop 2026-11-05 12:43:28 -05:00
Owner

Listener-level tests now cover zone-transfer rate limiting over TLS and QUIC and the Router Advertisement pending-reply cap.

Tests (real listeners on loopback; QUIC tests return early without libmsquic, and ran here):

  • DnsOverTlsZoneTransferRateLimitTests (4) and DnsOverQuicZoneTransferRateLimitTests (3): an AXFR beyond the budget gets no reply (TLS closes the connection; QUIC resets the stream with DOQ_EXCESSIVE_LOAD, RFC 9250 §4.3); a subnet Drop never calls the transfer service; a served AXFR publishes exactly one query-log event; a denied one publishes none.
  • Icmpv6RaListenerPendingReplyCapTests (6): the cap of 16 pending solicited replies, a finished reply freeing a slot, and RFC 4861 §6.2.6 coalescing of :: solicitations.

Production changes (small):

  • Icmpv6RaListener: the admission check moves unchanged out of the raw-socket receive loop into internal TryAdmitSolicitation, so it can be tested without CAP_NET_RAW.
  • DnsOverTlsListener.BoundPort and DnsOverQuicListener.BoundPort report the port bound (meaningful for a single-address listener), so tests start on port 0 per the AGENTS.md rule.
  • ZoneTransferRequestRunner logs a denied transfer at Debug with the client, the zone and the reason, like rate-limited queries; TCP, DoT and DoQ pass their logger. Denied transfers still publish no query-log event.

Port rule: the new tests and the existing DoT/DoQ tests use port 0 + BoundPort; two multi-address tests that need one shared port keep GetFreePort() with a comment.

Mutation checks (scratch, restored): removing the runner's rate-limit check, or not passing the limiter to the DoT/DoQ listener, fails 2 of 3 transfer tests each; a different DoQ abort code fails them; raising the RA cap fails 4 of 6; removing :: coalescing fails 2 of 6; removing the pending-flag reset fails 1; logging at Trace instead of Debug fails the log test.

Results: new classes 10/10 runs; DoT 47, DoQ 21, Plain 19, Authoritative 670, Ra 120 pass; full DoT and DoQ suites 10/10 after the port conversion; build 0 warnings; csharpier clean.

Closes #55

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

Listener-level tests now cover zone-transfer rate limiting over TLS and QUIC and the Router Advertisement pending-reply cap. Tests (real listeners on loopback; QUIC tests return early without libmsquic, and ran here): - `DnsOverTlsZoneTransferRateLimitTests` (4) and `DnsOverQuicZoneTransferRateLimitTests` (3): an AXFR beyond the budget gets no reply (TLS closes the connection; QUIC resets the stream with DOQ_EXCESSIVE_LOAD, RFC 9250 §4.3); a subnet Drop never calls the transfer service; a served AXFR publishes exactly one query-log event; a denied one publishes none. - `Icmpv6RaListenerPendingReplyCapTests` (6): the cap of 16 pending solicited replies, a finished reply freeing a slot, and RFC 4861 §6.2.6 coalescing of `::` solicitations. Production changes (small): - `Icmpv6RaListener`: the admission check moves unchanged out of the raw-socket receive loop into `internal TryAdmitSolicitation`, so it can be tested without CAP_NET_RAW. - `DnsOverTlsListener.BoundPort` and `DnsOverQuicListener.BoundPort` report the port bound (meaningful for a single-address listener), so tests start on port 0 per the AGENTS.md rule. - `ZoneTransferRequestRunner` logs a denied transfer at Debug with the client, the zone and the reason, like rate-limited queries; TCP, DoT and DoQ pass their logger. Denied transfers still publish no query-log event. Port rule: the new tests and the existing DoT/DoQ tests use port 0 + `BoundPort`; two multi-address tests that need one shared port keep `GetFreePort()` with a comment. Mutation checks (scratch, restored): removing the runner's rate-limit check, or not passing the limiter to the DoT/DoQ listener, fails 2 of 3 transfer tests each; a different DoQ abort code fails them; raising the RA cap fails 4 of 6; removing `::` coalescing fails 2 of 6; removing the pending-flag reset fails 1; logging at Trace instead of Debug fails the log test. Results: new classes 10/10 runs; DoT 47, DoQ 21, Plain 19, Authoritative 670, Ra 120 pass; full DoT and DoQ suites 10/10 after the port conversion; build 0 warnings; csharpier clean. Closes #55 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #55

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Closes #55

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #55

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #55

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
A zone transfer denied by a rate limit is logged at Debug with the client, the zone and the reason
Some checks failed
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Has been skipped
Build / Stage Draft Release (push) Successful in -2m37s
Build / Pack and Push NuGet Packages (common) (push) Successful in -2m24s
Build / Pack and Push NuGet Packages (dhcp) (push) Successful in -1m38s
Build / Build Binary (linux-amd64) (pull_request) Has been skipped
Build / Build Binary (linux-arm64) (pull_request) Has been skipped
Build / Build Binary (macos-amd64) (pull_request) Has been skipped
Build / Build Binary (macos-arm64) (pull_request) Has been skipped
Build / Build Binary (windows-amd64) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (push) Successful in -1m37s
Build / Smoke Test the Windows Binary (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (push) Successful in 2m51s
Build / Build Binary (linux-amd64) (push) Successful in 1m2s
Build / Build Binary (linux-arm64) (push) Successful in 1m4s
Build / Build Arch Linux Packages (pull_request) Has been skipped
Build / Build Binary (macos-amd64) (push) Successful in 1m4s
Build / Build and Test Deb and RPM Packages (pull_request) Has been skipped
Build / Build and Push Image (pull_request) Has been skipped
Build / Build Binary (macos-arm64) (push) Successful in 5m46s
Build / Build Binary (windows-amd64) (push) Successful in 5m20s
Build / Publish Release (pull_request) Has been skipped
Build / Pipeline (pull_request) Failing after 0s
Build / Smoke Test the Windows Binary (push) Successful in 17s
Build / Build and Push Image (push) Successful in 19s
Build / Build Arch Linux Packages (push) Successful in 46s
Build / Build and Test Deb and RPM Packages (push) Successful in 3m32s
Build / Publish Release (push) Successful in 9s
Build / Pipeline (push) Successful in 0s
7dd35861e7
Refs #55

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit efe646be76 into develop 2026-11-05 12:43:28 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!308
No description provided.