瀏覽代碼

Merge pull request #18 from steveeJ/version-detect-fix

iptables: error out on version check failure
Jonathan Boulle 9 年之前
父節點
當前提交
aab13f7370
共有 1 個文件被更改,包括 1 次插入4 次删除
  1. 1 4
      iptables/iptables.go

+ 1 - 4
iptables/iptables.go

@@ -18,7 +18,6 @@ import (
 	"bytes"
 	"fmt"
 	"io"
-	"log"
 	"os/exec"
 	"regexp"
 	"strconv"
@@ -53,9 +52,7 @@ func New() (*IPTables, error) {
 	}
 	checkPresent, waitPresent, err := getIptablesCommandSupport()
 	if err != nil {
-		log.Printf("Error checking iptables version, assuming version at least 1.4.20: %v", err)
-		checkPresent = true
-		waitPresent = true
+		return nil, fmt.Errorf("error checking iptables version: %v", err)
 	}
 	ipt := IPTables{
 		path:     path,