diff --git a/libnetwork/iptables/iptables.go b/libnetwork/iptables/iptables.go index 51a3e2bdc2..c8da33e457 100644 --- a/libnetwork/iptables/iptables.go +++ b/libnetwork/iptables/iptables.go @@ -116,11 +116,7 @@ func detectIptables() { return } iptablesPath = path - path, err = exec.LookPath("ip6tables") - if err != nil { - return - } - ip6tablesPath = path + supportsXlock = exec.Command(iptablesPath, "--wait", "-L", "-n").Run() == nil mj, mn, mc, err := GetVersion() if err != nil { @@ -128,6 +124,13 @@ func detectIptables() { return } supportsCOpt = supportsCOption(mj, mn, mc) + + path, err = exec.LookPath("ip6tables") + if err != nil { + return + } else { + ip6tablesPath = path + } } func initDependencies() {