diff options
| author | Russ Cox <rsc@golang.org> | 2016-01-06 14:37:45 -0500 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-05-05 19:15:38 +0000 |
| commit | fafd792de30f46cbd822fd6bb041c60c7b5fbe6d (patch) | |
| tree | f187fb298f583aff9f3e398f61965afa897124c1 | |
| parent | eeca3ba92fdb07e44abf3e2bebfcede03e1eae12 (diff) | |
| download | go-fafd792de30f46cbd822fd6bb041c60c7b5fbe6d.tar.xz | |
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>
| -rw-r--r-- | src/net/conf.go | 2 | ||||
| -rw-r--r-- | src/net/conf_test.go | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/net/conf.go b/src/net/conf.go index 48372e5197..eb729167f5 100644 --- a/src/net/conf.go +++ b/src/net/conf.go @@ -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 diff --git a/src/net/conf_test.go b/src/net/conf_test.go index 8f39847804..ec8814b845 100644 --- a/src/net/conf_test.go +++ b/src/net/conf_test.go @@ -257,6 +257,7 @@ func TestConfHostLookupOrder(t *testing.T) { hostTests: []nssHostTest{ {"x.com", hostLookupFilesDNS}, {"somehostname", hostLookupCgo}, + {"", hostLookupFilesDNS}, // Issue 13623 }, }, { |
