aboutsummaryrefslogtreecommitdiff
path: root/src/net/dnsclient_unix.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2016-04-25 13:09:11 -0700
committerMatthew Dempsky <mdempsky@google.com>2016-04-26 16:23:39 +0000
commit98b99d561225cc1d140360b217df2acc9aa1f746 (patch)
tree3c90710dbf880de8be17bfc2cdf4228b748f1024 /src/net/dnsclient_unix.go
parent96b8f70e22e103c11fbb89ba6df9d229d24cdbc2 (diff)
downloadgo-98b99d561225cc1d140360b217df2acc9aa1f746.tar.gz
go-98b99d561225cc1d140360b217df2acc9aa1f746.zip
net: ignore lame referral responses like libresolv
Fixes #15434. Change-Id: Ia88b740df5418a6d3af1c29a03756f4234f388b0 Reviewed-on: https://go-review.googlesource.com/22428 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/net/dnsclient_unix.go')
-rw-r--r--src/net/dnsclient_unix.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/net/dnsclient_unix.go b/src/net/dnsclient_unix.go
index 6a1fdfccb8..3e31056a93 100644
--- a/src/net/dnsclient_unix.go
+++ b/src/net/dnsclient_unix.go
@@ -204,6 +204,12 @@ func tryOneName(ctx context.Context, cfg *dnsConfig, name string, qtype uint16)
}
continue
}
+ // libresolv continues to the next server when it receives
+ // an invalid referral response. See golang.org/issue/15434.
+ if msg.rcode == dnsRcodeSuccess && !msg.authoritative && !msg.recursion_available && len(msg.answer) == 0 && len(msg.extra) == 0 {
+ lastErr = &DNSError{Err: "lame referral", Name: name, Server: server}
+ continue
+ }
cname, rrs, err := answer(name, server, msg, qtype)
// If answer errored for rcodes dnsRcodeSuccess or dnsRcodeNameError,
// it means the response in msg was not useful and trying another