Merge branch 'master' of github.com:miekg/dns

This commit is contained in:
Miek Gieben 2014-02-10 15:31:20 +00:00
commit 8f334b52a0
2 changed files with 4 additions and 3 deletions

View File

@ -176,6 +176,7 @@ func TestIsDomainName(t *testing.T) {
"..": &ret{false, 1},
"@.": &ret{true, 1},
"www.example.com": &ret{true, 3},
"www.e%ample.com": &ret{true, 3},
"www.example.com.": &ret{true, 3},
"mi\\k.nl.": &ret{true, 2},
"mi\\k.nl": &ret{true, 2},

6
msg.go
View File

@ -1440,9 +1440,9 @@ func (dns *Msg) Unpack(msg []byte) (err error) {
return err
}
}
// If we have seen a TC bit being set, we return here, without
// an error, because technically it isn't an error. So we return
// without parsing, the potentially corrupt packet.
// If we see a TC bit being set we return here, without
// an error, because technically it isn't an error. So return
// without parsing the potentially corrupt packet and hitting an error.
if dns.Truncated {
dns.Answer = nil
dns.Ns = nil