Переглянути джерело

Merge pull request #52 from dcbw/nft-non-existent-chains

iptables in nft mode now prints an error for non-existent chains
Casey Callendrello 5 роки тому
батько
коміт
0c43e9f803
1 змінених файлів з 0 додано та 12 видалено
  1. 0 12
      iptables/iptables.go

+ 0 - 12
iptables/iptables.go

@@ -348,18 +348,6 @@ func (ipt *IPTables) executeList(args []string) ([]string, error) {
 		rules = rules[:len(rules)-1]
 	}
 
-	// nftables mode doesn't return an error code when listing a non-existent
-	// chain. Patch that up.
-	if len(rules) == 0 && ipt.mode == "nf_tables" {
-		v := 1
-		return nil, &Error{
-			cmd:        exec.Cmd{Args: args},
-			msg:        fmt.Sprintf("%s: No chain/target/match by that name.\n", getIptablesCommand(ipt.proto)),
-			proto:      ipt.proto,
-			exitStatus: &v,
-		}
-	}
-
 	for i, rule := range rules {
 		rules[i] = filterRuleOutput(rule)
 	}