Date: Sat, 28 Nov 2009 21:40:57 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r199896 - head/sys/netipsec Message-ID: <200911282140.nASLevDa067738@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Sat Nov 28 21:40:57 2009 New Revision: 199896 URL: http://svn.freebsd.org/changeset/base/199896 Log: Directly send data uncompressed if the packet payload size is lower than the compression algorithm threshold. MFC after: 6 days Modified: head/sys/netipsec/xform_ipcomp.c Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sat Nov 28 21:08:19 2009 (r199895) +++ head/sys/netipsec/xform_ipcomp.c Sat Nov 28 21:40:57 2009 (r199896) @@ -343,6 +343,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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911282140.nASLevDa067738>