A stored record of a type with no codec no longer makes zone transfers fail #273

Closed
opened 2026-11-05 00:44:06 -05:00 by claude · 0 comments
Owner
  • Draft: none (found by the verifier on #28)
  • Priority: medium (one stored row of a type with no codec fails every AXFR of its zone)
  • Agent: protocol-coder
  • Depends on: #28
  • Decisions: none

Why

RecordEntityCodec.ToWireRecord returns null for a record type that has no RDATA codec.
RecordEntityCodec.CanWriteRdata (added by #28) lets such a record pass, so it stays in the
cached zone. The AXFR path in
src/dotnet/src/Ninlil.Dns.Server.Authoritative/Transfer/ZoneTransferService.cs (around lines
122-127) does not filter the nulls, and DeduplicateRecords (around line 827) then reads
record.Name and throws NullReferenceException. Rows of such a type can arrive by a restore, a
storage switch, a cluster sync or a hand edit, like #28's unwritable rows. TryWriteSoa likewise
returns false with no log when the SOA converts to null (theoretical while the SOA codec is
registered).

What changes

Treat "no codec for this type" like unwritable data: CanWriteRdata (or the cache load) leaves
the record out with the same one Warning naming zone, type, name, id and reason, so the resolver,
AXFR, IXFR and the signer all see the same zone. Check every other caller of ToWireRecord that
can see a null and decide per site. TryWriteSoa logs its Warning for a null too.

Acceptance

  • Authoritative.Tests, red first: a zone with one stored row of a type with no codec answers
    queries for other names and completes an AXFR without that row; one Warning.
  • Authoritative.Tests and Dnssec.Tests pass.

Source

Verifier report on #28 (finding 1).

- **Draft:** none (found by the verifier on #28) - **Priority:** medium (one stored row of a type with no codec fails every AXFR of its zone) - **Agent:** protocol-coder - **Depends on:** #28 - **Decisions:** none ### Why `RecordEntityCodec.ToWireRecord` returns `null` for a record type that has no RDATA codec. `RecordEntityCodec.CanWriteRdata` (added by #28) lets such a record pass, so it stays in the cached zone. The AXFR path in `src/dotnet/src/Ninlil.Dns.Server.Authoritative/Transfer/ZoneTransferService.cs` (around lines 122-127) does not filter the nulls, and `DeduplicateRecords` (around line 827) then reads `record.Name` and throws `NullReferenceException`. Rows of such a type can arrive by a restore, a storage switch, a cluster sync or a hand edit, like #28's unwritable rows. `TryWriteSoa` likewise returns `false` with no log when the SOA converts to `null` (theoretical while the SOA codec is registered). ### What changes Treat "no codec for this type" like unwritable data: `CanWriteRdata` (or the cache load) leaves the record out with the same one Warning naming zone, type, name, id and reason, so the resolver, AXFR, IXFR and the signer all see the same zone. Check every other caller of `ToWireRecord` that can see a null and decide per site. `TryWriteSoa` logs its Warning for a null too. ### Acceptance - [ ] Authoritative.Tests, red first: a zone with one stored row of a type with no codec answers queries for other names and completes an AXFR without that row; one Warning. - [ ] Authoritative.Tests and Dnssec.Tests pass. ### Source Verifier report on #28 (finding 1).
Sign in to join this conversation.
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.

Reference
lantea-one/ninlil#273
No description provided.