mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05: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)
This commit is contained in:
parent
a7722d752d
commit
2fcbfb5a66
1 changed files with 5 additions and 0 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue