1
0
mirror of https://github.com/docker/cli.git synced 2026-01-13 18:22:35 +03:00

Adds check if default ip address is correct format.

It avoids hidden error when ports are redirected from
container to host using -p host_port:guest_port.

Docker-DCO-1.1-Signed-off-by: Jiří Župka <jzupka@redhat.com> (github: jzupka)
Upstream-commit: 2fcbfb5a66249739ef04d414307be01371190bef
Component: engine
This commit is contained in:
Jiří Župka
2014-06-27 15:55:20 +02:00
parent 1bed6872f0
commit 11bdd53bca

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"io/ioutil"
"log"
"net"
"os"
"runtime"
"strings"
@@ -99,6 +100,10 @@ func main() {
log.Fatal("You specified --iptables=false with --icc=false. ICC uses iptables to function. Please set --icc or --iptables to true.")
}
if net.ParseIP(*flDefaultIp) == nil {
log.Fatalf("Specified --ip=%s is not in correct format \"0.0.0.0\".", *flDefaultIp)
}
if *flDebug {
os.Setenv("DEBUG", "1")
}