fix: add debug logging for DoT SERVFAIL serialization failure, TC-bit TODO

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Razvan Dimescu
2026-03-30 01:31:51 +03:00
parent ee310fe7cb
commit 349ed3378f
2 changed files with 3 additions and 0 deletions

View File

@@ -310,6 +310,8 @@ pub async fn resolve_query(
); );
// Serialize response // Serialize response
// TODO: TC bit is UDP-specific; DoT connections could carry up to 65535 bytes.
// Once BytePacketBuffer supports larger buffers, skip truncation for TCP/TLS.
let mut resp_buffer = BytePacketBuffer::new(); let mut resp_buffer = BytePacketBuffer::new();
if response.write(&mut resp_buffer).is_err() { if response.write(&mut resp_buffer).is_err() {
// Response too large — set TC bit and send header + question only // Response too large — set TC bit and send header + question only

View File

@@ -175,6 +175,7 @@ where
resp.header.rescode = ResultCode::SERVFAIL; resp.header.rescode = ResultCode::SERVFAIL;
let mut buf = BytePacketBuffer::new(); let mut buf = BytePacketBuffer::new();
if resp.write(&mut buf).is_err() { if resp.write(&mut buf).is_err() {
debug!("DoT: failed to serialize SERVFAIL for {}", remote_addr);
break; break;
} }
buf buf