From owner-svn-src-stable-8@FreeBSD.ORG Sat Dec 5 19:03:20 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73E36106566B; Sat, 5 Dec 2009 19:03:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 629258FC17; Sat, 5 Dec 2009 19:03:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5J3KBK096428; Sat, 5 Dec 2009 19:03:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5J3KtJ096426; Sat, 5 Dec 2009 19:03:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051903.nB5J3KtJ096426@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200141 - stable/8/sys/netipsec X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:03:20 -0000 Author: bz Date: Sat Dec 5 19:03:20 2009 New Revision: 200141 URL: http://svn.freebsd.org/changeset/base/200141 Log: MFC r199896: Directly send data uncompressed if the packet payload size is lower than the compression algorithm threshold. Modified: stable/8/sys/netipsec/xform_ipcomp.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/netipsec/xform_ipcomp.c ============================================================================== --- stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:01:50 2009 (r200140) +++ stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:03:20 2009 (r200141) @@ -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;