1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

handle truncated DNS messages. fix #713

This commit is contained in:
Darien Raymond 2017-11-18 20:00:09 +01:00
parent ed1243b32b
commit 878d412c6a
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -98,7 +98,9 @@ func (v *UDPNameServer) AssignUnusedID(response chan<- *ARecord) uint16 {
func (v *UDPNameServer) HandleResponse(payload *buf.Buffer) {
msg := new(dns.Msg)
err := msg.Unpack(payload.Bytes())
if err != nil {
if err == dns.ErrTruncated {
log.Trace(newError("truncated message received. DNS server should still work. If you see anything abnormal, please submit an issue to v2ray-core.").AtWarning())
} else if err != nil {
log.Trace(newError("failed to parse DNS response").Base(err).AtWarning())
return
}