mirror of https://github.com/golang/go.git
net: fix hostLookupOrder("")
Fixes #13623. Change-Id: I1bd96aa7b6b715e4dbdcf0c37c2d29228df6565c Reviewed-on: https://go-review.googlesource.com/18329 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
eeca3ba92f
commit
fafd792de3
|
|
@ -220,7 +220,7 @@ func (c *conf) hostLookupOrder(hostname string) (ret hostLookupOrder) {
|
|||
var first string
|
||||
for _, src := range srcs {
|
||||
if src.source == "myhostname" {
|
||||
if hasDot {
|
||||
if hostname == "" || hasDot {
|
||||
continue
|
||||
}
|
||||
return fallbackOrder
|
||||
|
|
|
|||
|
|
@ -257,6 +257,7 @@ func TestConfHostLookupOrder(t *testing.T) {
|
|||
hostTests: []nssHostTest{
|
||||
{"x.com", hostLookupFilesDNS},
|
||||
{"somehostname", hostLookupCgo},
|
||||
{"", hostLookupFilesDNS}, // Issue 13623
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue