diff --git a/daemon/daemon.go b/daemon/daemon.go index 7328e8fb26..f68197b2f6 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -677,6 +677,13 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error) // FIXME: GetDefaultNetwork Mtu doesn't need to be public anymore config.Mtu = GetDefaultNetworkMtu() } + // Check for mutually incompatible config options + if config.BridgeIface != "" && config.BridgeIP != "" { + return nil, fmt.Errorf("You specified -b & --bip, mutually exclusive options. Please specify only one.") + } + if !config.EnableIptables && !config.InterContainerCommunication { + return nil, fmt.Errorf("You specified --iptables=false with --icc=false. ICC uses iptables to function. Please set --icc or --iptables to true.") + } // FIXME: DisableNetworkBidge doesn't need to be public anymore config.DisableNetwork = config.BridgeIface == DisableNetworkBridge diff --git a/docker/daemon.go b/docker/daemon.go index 089eae5464..948412ea86 100644 --- a/docker/daemon.go +++ b/docker/daemon.go @@ -30,15 +30,6 @@ func mainDaemon() { flag.Usage() return } - - // FIXME: validate daemon.Config values in a method of daemon.Config - if daemonCfg.BridgeIface != "" && daemonCfg.BridgeIP != "" { - log.Fatal("You specified -b & --bip, mutually exclusive options. Please specify only one.") - } - - if !daemonCfg.EnableIptables && !daemonCfg.InterContainerCommunication { - log.Fatal("You specified --iptables=false with --icc=false. ICC uses iptables to function. Please set --icc or --iptables to true.") - } eng := engine.New() signal.Trap(eng.Shutdown) // Load builtins