From c74a0836729a552bf3cd08170705fb80a989a2c2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 7 Jul 2023 09:29:59 +0200 Subject: [PATCH] libnetwork/iptables: IPTable.ExistChain(): remove redundant if/else Signed-off-by: Sebastiaan van Stijn --- libnetwork/iptables/iptables.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libnetwork/iptables/iptables.go b/libnetwork/iptables/iptables.go index e77e39f1eb..c243c9c3d4 100644 --- a/libnetwork/iptables/iptables.go +++ b/libnetwork/iptables/iptables.go @@ -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