Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Dec 2009 19:12:35 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r200147 - stable/8/sys/opencrypto
Message-ID:  <200912051912.nB5JCZnn096929@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912051912.nB5JCZnn096929>