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