svn commit: r201242 - stable/7/sys/opencrypto

Bjoern A. Zeeb bz at
Tue Dec 29 23:47:22 UTC 2009

Author: bz
Date: Tue Dec 29 23:47:21 2009
New Revision: 201242

  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

Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/opencrypto/cryptosoft.c
--- stable/7/sys/opencrypto/cryptosoft.c	Tue Dec 29 23:44:32 2009	(r201241)
+++ stable/7/sys/opencrypto/cryptosoft.c	Tue Dec 29 23:47:21 2009	(r201242)
@@ -543,7 +543,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 */
 			return 0;

More information about the svn-src-stable-7 mailing list