svn commit: r201237 - stable/7/sys/netipsec

Bjoern A. Zeeb bz at FreeBSD.org
Tue Dec 29 23:33:20 UTC 2009


Author: bz
Date: Tue Dec 29 23:33:20 2009
New Revision: 201237
URL: http://svn.freebsd.org/changeset/base/201237

Log:
  MFC r199896:
  
    Directly send data uncompressed if the packet payload size is lower than
    the compression algorithm threshold.

Modified:
  stable/7/sys/netipsec/xform_ipcomp.c
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/netipsec/xform_ipcomp.c
==============================================================================
--- stable/7/sys/netipsec/xform_ipcomp.c	Tue Dec 29 23:31:21 2009	(r201236)
+++ stable/7/sys/netipsec/xform_ipcomp.c	Tue Dec 29 23:33:20 2009	(r201237)
@@ -345,6 +345,17 @@ ipcomp_output(
 	ipcompx = sav->tdb_compalgxform;
 	IPSEC_ASSERT(ipcompx != NULL, ("null compression xform"));
 
+	/*
+	 * Do not touch the packet in case our payload to compress
+	 * is lower than the minimal threshold of the compression
+	 * alogrithm.  We will just send out the data uncompressed.
+	 * See RFC 3173, 2.2. Non-Expansion Policy.
+	 */
+	if (m->m_pkthdr.len <= ipcompx->minlen) {
+		/* XXX-BZ V_ipcompstat.threshold++; */
+		return ipsec_process_done(m, isr);
+	}
+
 	ralen = m->m_pkthdr.len - skip;	/* Raw payload length before comp. */
 	hlen = IPCOMP_HLENGTH;
 


More information about the svn-src-all mailing list