utils: iptables: Use go-iptables' ChainExists()
Starting with v0.5.0, go-iptables exports a fast ChainExists() which does not rely upon listing all chains and searching the results but probes chain existence by listing its first rule. This should make a significant difference in rulesets with thousands of chains. Signed-off-by: Phil Sutter <psutter@redhat.com>
This commit is contained in:
@ -103,7 +103,7 @@ func (c *chain) teardown(ipt *iptables.IPTables) error {
|
||||
|
||||
// check the chain.
|
||||
func (c *chain) check(ipt *iptables.IPTables) error {
|
||||
exists, err := utils.ChainExists(ipt, c.table, c.name)
|
||||
exists, err := ipt.ChainExists(c.table, c.name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user