From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 09:07:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D622CA75; Thu, 4 Sep 2014 09:07:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1616196E; Thu, 4 Sep 2014 09:07:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8497EdK000778; Thu, 4 Sep 2014 09:07:14 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8497Emt000776; Thu, 4 Sep 2014 09:07:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409040907.s8497Emt000776@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 4 Sep 2014 09:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271088 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 09:07:14 -0000 Author: glebius Date: Thu Sep 4 09:07:14 2014 New Revision: 271088 URL: http://svnweb.freebsd.org/changeset/base/271088 Log: Provide m_catpkt(), a wrapper around m_cat() that deals with M_PKTHDR mbufs. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Thu Sep 4 06:07:32 2014 (r271087) +++ head/sys/kern/uipc_mbuf.c Thu Sep 4 09:07:14 2014 (r271088) @@ -990,6 +990,22 @@ m_cat(struct mbuf *m, struct mbuf *n) } } +/* + * Concatenate two pkthdr mbuf chains. + */ +void +m_catpkt(struct mbuf *m, struct mbuf *n) +{ + + M_ASSERTPKTHDR(m); + M_ASSERTPKTHDR(n); + + m->m_pkthdr.len += n->m_pkthdr.len; + m_demote(n, 1); + + m_cat(m, n); +} + void m_adj(struct mbuf *mp, int req_len) { Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Sep 4 06:07:32 2014 (r271087) +++ head/sys/sys/mbuf.h Thu Sep 4 09:07:14 2014 (r271088) @@ -915,6 +915,7 @@ int m_apply(struct mbuf *, int, int, int (*)(void *, void *, u_int), void *); int m_append(struct mbuf *, int, c_caddr_t); void m_cat(struct mbuf *, struct mbuf *); +void m_catpkt(struct mbuf *, struct mbuf *); int m_extadd(struct mbuf *, caddr_t, u_int, void (*)(struct mbuf *, void *, void *), void *, void *, int, int, int);