net/dns/resolver: log forwarded query details when TS_DEBUG_DNS_FORWARD_SEND is enabled

Troubleshooting DNS resolution issues often requires additional information.
This PR expands the effect of the TS_DEBUG_DNS_FORWARD_SEND envknob to forwarder.forwardWithDestChan,
and includes the request type, domain name length, and the first 3 bytes of the domain's SHA-256 hash in the output.

Fixes #13070

Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
Nick Khyl
2024-08-08 15:41:08 -05:00
committed by Nick Khyl
parent a867a4869d
commit f23932bd98
2 changed files with 28 additions and 9 deletions

View File

@@ -201,7 +201,7 @@ func BenchmarkNameFromQuery(b *testing.B) {
b.ResetTimer()
b.ReportAllocs()
for range b.N {
_, err := nameFromQuery(msg)
_, _, err := nameFromQuery(msg)
if err != nil {
b.Fatal(err)
}