diff --git a/libnetwork/iptables/iptables.go b/libnetwork/iptables/iptables.go index 51a3e2bdc22a1c14c757402dd16a186ae96571cc..c8da33e457e1492c74220291605f4a81c9100124 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() {