From: David du Colombier <0intro@gmail.com> Date: Mon, 24 Oct 2016 22:31:45 +0000 (+0200) Subject: net: handle "dns failure" as errNoSuchHost on Plan 9 X-Git-Tag: go1.8beta1~664 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c63db157bd669845a23255ab268596669a5ea5df;p=gostls13.git net: handle "dns failure" as errNoSuchHost on Plan 9 CL 31468 added TestLookupNonLDH, which was failing on Plan 9, because LookupHost was expecting to return errNoSuchHost on DNS resolution failure, while Plan 9 returned the "dns failure" string. In the Plan 9 implementation of lookupHost, we now return errNoSuchHost instead of the "dns failure" string, so the behavior is more consistant with other operating systems. Fixes #17568. Change-Id: If64f580dc0626a4a4f19e5511ba2ca5daff5f789 Reviewed-on: https://go-review.googlesource.com/31873 Run-TryBot: David du Colombier <0intro@gmail.com> Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/net/lookup_plan9.go b/src/net/lookup_plan9.go index b5cf7aaab5..11f2349afe 100644 --- a/src/net/lookup_plan9.go +++ b/src/net/lookup_plan9.go @@ -122,6 +122,9 @@ func (*Resolver) lookupHost(ctx context.Context, host string) (addrs []string, e // host names in local network (e.g. from /lib/ndb/local) lines, err := queryCS(ctx, "net", host, "1") if err != nil { + if stringsHasSuffix(err.Error(), "dns failure") { + err = errNoSuchHost + } return } loop: