Treat 0.0.0.0 as local address in --address flag (#4386)

This commit is contained in:
Krishnan Parthasarathi
2017-05-24 00:37:39 +05:30
committed by Harshavardhana
parent 28c26a9e59
commit 3c5db69ffd
2 changed files with 5 additions and 1 deletions

View File

@@ -319,7 +319,10 @@ func CheckLocalServerAddr(serverAddr string) error {
return fmt.Errorf("port number must be between 1 to 65535")
}
if host != "" {
// 0.0.0.0 is a wildcard address and refers to local network
// addresses. I.e, 0.0.0.0:9000 like ":9000" refers to port
// 9000 on localhost.
if host != "" && host != net.IPv4zero.String() {
isLocalHost, err := isLocalHost(host)
if err != nil {
return err