]> Cypherpunks repositories - gostls13.git/commitdiff
net: use original argument in lookup error
authorRuss Cox <rsc@golang.org>
Thu, 3 Oct 2013 02:09:54 +0000 (22:09 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 3 Oct 2013 02:09:54 +0000 (22:09 -0400)
Fixes #6324.

R=golang-dev, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/13280049

src/pkg/net/dnsclient_unix.go

index f42e9d321f4ec68a47029c2351b8e0dae62e26c3..16cf420dcdb87e2cd80914496b3b05eb35f9f642 100644 (file)
@@ -211,6 +211,12 @@ func lookup(name string, qtype uint16) (cname string, addrs []dnsRR, err error)
        if err == nil {
                return
        }
+       if e, ok := err.(*DNSError); ok {
+               // Show original name passed to lookup, not suffixed one.
+               // In general we might have tried many suffixes; showing
+               // just one is misleading. See also golang.org/issue/6324.
+               e.Name = name
+       }
        return
 }