dns: set timout only when multiple upstream dns servers set

This commit is contained in:
nadoo committed 2018-08-06 08:41:54 +08:00
1 parent 9c73e969ca
commit 7274dcf622
2 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -119,7 +119,7 @@ func (m *Message) Marshal() ([]byte, error) {
// UnmarshalMessage unmarshals []bytes to Message
func UnmarshalMessage(b []byte) (*Message, error) {
if len(b) <= 2+HeaderLen {
if len(b) < HeaderLen {
return nil, errors.New("UnmarshalMessage: not enough data")
}