libnetwork/iptables: IPTable.ExistChain(): remove redundant if/else

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-07-07 09:29:59 +02:00
parent 37b908aa62
commit c74a083672
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -554,10 +554,8 @@ func (iptable IPTable) RawCombinedOutputNative(args ...string) error {
// ExistChain checks if a chain exists
func (iptable IPTable) ExistChain(chain string, table Table) bool {
if _, err := iptable.Raw("-t", string(table), "-nL", chain); err == nil {
return true
}
return false
_, err := iptable.Raw("-t", string(table), "-nL", chain)
return err == nil
}
// SetDefaultPolicy sets the passed default policy for the table/chain