wgengine/tsdns: fix error response marshaling, improve bad query logs

Updates #995

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-12-16 22:14:36 -08:00
committed by Brad Fitzpatrick
parent 554a20becb
commit 741c513e51
2 changed files with 28 additions and 10 deletions
+10
View File
@@ -748,3 +748,13 @@ func BenchmarkFull(b *testing.B) {
})
}
}
func TestMarshalResponseFormatError(t *testing.T) {
resp := new(response)
resp.Header.RCode = dns.RCodeFormatError
v, err := marshalResponse(resp)
if err != nil {
t.Errorf("marshal error: %v", err)
}
t.Logf("response: %q", v)
}