Browse Source

Merge pull request #2285 from myobie/iptables-legacy

debian has iptables-legacy and iptables-nft now
Flavio Crisciani 6 years ago
parent
commit
941f87407d
1 changed files with 7 additions and 2 deletions
  1. 7 2
      libnetwork/iptables/iptables.go

+ 7 - 2
libnetwork/iptables/iptables.go

@@ -87,11 +87,16 @@ func initFirewalld() {
 }
 }
 
 
 func detectIptables() {
 func detectIptables() {
-	path, err := exec.LookPath("iptables")
+	path, err := exec.LookPath("iptables-legacy") // debian has iptables-legacy and iptables-nft now
 	if err != nil {
 	if err != nil {
-		return
+		path, err = exec.LookPath("iptables")
+		if err != nil {
+			return
+		}
 	}
 	}
+
 	iptablesPath = path
 	iptablesPath = path
+
 	supportsXlock = exec.Command(iptablesPath, "--wait", "-L", "-n").Run() == nil
 	supportsXlock = exec.Command(iptablesPath, "--wait", "-L", "-n").Run() == nil
 	mj, mn, mc, err := GetVersion()
 	mj, mn, mc, err := GetVersion()
 	if err != nil {
 	if err != nil {