Date: Mon, 4 Jan 2010 15:05:37 +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-6@freebsd.org Subject: svn commit: r201508 - stable/6/sys/opencrypto Message-ID: <201001041505.o04F5bZC093340@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Mon Jan 4 15:05:37 2010 New Revision: 201508 URL: http://svn.freebsd.org/changeset/base/201508 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/6/sys/opencrypto/cryptosoft.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/opencrypto/cryptosoft.c ============================================================================== --- stable/6/sys/opencrypto/cryptosoft.c Mon Jan 4 15:05:11 2010 (r201507) +++ stable/6/sys/opencrypto/cryptosoft.c Mon Jan 4 15:05:37 2010 (r201508) @@ -539,7 +539,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?201001041505.o04F5bZC093340>