From owner-svn-src-stable@FreeBSD.ORG Sat Dec 5 19:12:35 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F2E31065679; Sat, 5 Dec 2009 19:12:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1CB8FC14; Sat, 5 Dec 2009 19:12:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5JCZcc096931; Sat, 5 Dec 2009 19:12:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JCZnn096929; Sat, 5 Dec 2009 19:12:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051912.nB5JCZnn096929@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200147 - stable/8/sys/opencrypto X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:12:36 -0000 Author: bz Date: Sat Dec 5 19:12:35 2009 New Revision: 200147 URL: http://svn.freebsd.org/changeset/base/200147 Log: MFC r199906: In case the compression result is the same size as the orignal version, the compression was useless as well. Make sure to not update the data and return, else we would waste resources when decompressing. This also avoids the copyback() changing data other consumers like xform_ipcomp.c would have ignored because of no win and sent out without noting that compression was used, resulting in invalid packets at the receiver. Modified: stable/8/sys/opencrypto/cryptosoft.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/opencrypto/cryptosoft.c ============================================================================== --- stable/8/sys/opencrypto/cryptosoft.c Sat Dec 5 19:11:02 2009 (r200146) +++ stable/8/sys/opencrypto/cryptosoft.c Sat Dec 5 19:12:35 2009 (r200147) @@ -552,7 +552,7 @@ swcr_compdec(struct cryptodesc *crd, str sw->sw_size = result; /* Check the compressed size when doing compression */ if (crd->crd_flags & CRD_F_COMP) { - if (result > crd->crd_len) { + if (result >= crd->crd_len) { /* Compression was useless, we lost time */ free(out, M_CRYPTO_DATA); return 0;