From 63572567b453cc86f52e18f7b8d0f90ff4a4b581 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Wed, 25 Jan 2017 19:22:12 -0800 Subject: [PATCH 1/2] integration: test domain name URLs are rejected before binding --- integration/embed_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/integration/embed_test.go b/integration/embed_test.go index defa611ba41..71e41cc10da 100644 --- a/integration/embed_test.go +++ b/integration/embed_test.go @@ -40,6 +40,8 @@ func TestEmbedEtcd(t *testing.T) { {wpeers: 1, wclients: 1}, {wpeers: 2, wclients: 1}, {wpeers: 1, wclients: 2}, + {werr: "expected IP"}, + {werr: "expected IP"}, } urls := newEmbedURLs(10) @@ -58,6 +60,10 @@ func TestEmbedEtcd(t *testing.T) { setupEmbedCfg(&tests[5].cfg, []url.URL{urls[4]}, []url.URL{urls[5], urls[6]}) setupEmbedCfg(&tests[6].cfg, []url.URL{urls[7], urls[8]}, []url.URL{urls[9]}) + dnsURL, _ := url.Parse("http://whatever.test:12345") + tests[7].cfg.LCUrls = []url.URL{*dnsURL} + tests[8].cfg.LPUrls = []url.URL{*dnsURL} + dir := path.Join(os.TempDir(), fmt.Sprintf("embed-etcd")) os.RemoveAll(dir) defer os.RemoveAll(dir) From 5a67b0aba665913ea468be1e055d96a702aebade Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Wed, 25 Jan 2017 19:23:10 -0800 Subject: [PATCH 2/2] embed: reject binding listeners to domain names Fixes #6336 --- embed/config.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/embed/config.go b/embed/config.go index ed647a0637b..2772f518ee7 100644 --- a/embed/config.go +++ b/embed/config.go @@ -405,8 +405,7 @@ func checkBindURLs(urls []url.URL) error { continue } if net.ParseIP(host) == nil { - err := fmt.Errorf("expected IP in URL for binding (%s)", url.String()) - plog.Warning(err) + return fmt.Errorf("expected IP in URL for binding (%s)", url.String()) } } return nil