Code review

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben 2018-11-28 22:40:08 +00:00
parent fef7963e99
commit f92da6fc6e
1 changed files with 1 additions and 1 deletions

2
msg.go
View File

@ -779,7 +779,6 @@ func (dns *Msg) packBufferWithCompressionMap(buf []byte, compression map[string]
}
func (dns *Msg) unpack(dh Header, msg []byte, off int) (err error) {
dns.setHdr(dh)
// If we are at the end of the message we should return *just* the
// header. This can still be useful to the caller. 9.9.9.9 sends these
// when responding with REFUSED for instance.
@ -842,6 +841,7 @@ func (dns *Msg) Unpack(msg []byte) (err error) {
return err
}
dns.setHdr(dh)
return dns.unpack(dh, msg, off)
}