浏览代码

Return error when iptables is not found

Shawn Siefkas 12 年之前
父节点
当前提交
c66d2b6a53
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      network.go

+ 1 - 1
network.go

@@ -70,7 +70,7 @@ func networkSize(mask net.IPMask) (int32, error) {
 func iptables(args ...string) error {
 	path, err := exec.LookPath("iptables")
 	if err != nil {
-		log.Fatal("command not found: iptables")
+		return fmt.Errorf("command not found: iptables")
 	}
 	if err := exec.Command(path, args...).Run(); err != nil {
 		return fmt.Errorf("iptables failed: iptables %v", strings.Join(args, " "))