From owner-svn-src-all@freebsd.org Wed Mar 2 04:58:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 987D5AC0B2B; Wed, 2 Mar 2016 04:58:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 50C511AB3; Wed, 2 Mar 2016 04:58:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u224wpeS062906; Wed, 2 Mar 2016 04:58:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u224wpEQ062904; Wed, 2 Mar 2016 04:58:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201603020458.u224wpEQ062904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Mar 2016 04:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296301 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2016 04:58:52 -0000 Author: markj Date: Wed Mar 2 04:58:51 2016 New Revision: 296301 URL: https://svnweb.freebsd.org/changeset/base/296301 Log: Document m_catpkt(), and remove misinformation about m_cat(9). Since m_cat() may copy data from the second mbuf chain into the last mbuf of the first chain, it may free the first mbuf of the second chain. Thus, the second chain is not guaranteed to be valid after m_cat() returns. Reviewed by: glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5497 Modified: head/share/man/man9/Makefile head/share/man/man9/mbuf.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Mar 2 04:56:36 2016 (r296300) +++ head/share/man/man9/Makefile Wed Mar 2 04:58:51 2016 (r296301) @@ -1053,6 +1053,7 @@ MLINKS+=\ mbuf.9 m_append.9 \ mbuf.9 m_apply.9 \ mbuf.9 m_cat.9 \ + mbuf.9 m_catpkt.9 \ mbuf.9 MCHTYPE.9 \ mbuf.9 MCLGET.9 \ mbuf.9 m_collapse.9 \ Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Wed Mar 2 04:56:36 2016 (r296300) +++ head/share/man/man9/mbuf.9 Wed Mar 2 04:58:51 2016 (r296301) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2015 +.Dd February 29, 2016 .Dt MBUF 9 .Os .\" @@ -122,6 +122,8 @@ .Fc .Ft void .Fn m_cat "struct mbuf *m" "struct mbuf *n" +.Ft void +.Fn m_catpkt "struct mbuf *m" "struct mbuf *n" .Ft u_int .Fn m_fixhdr "struct mbuf *mbuf" .Ft void @@ -907,12 +909,26 @@ to Both .Vt mbuf chains must be of the same type. -.Fa N -is still valid after the function returned. -.Sy Note : -It does not handle -.Dv M_PKTHDR -and friends. +.Fa n +is not guaranteed to be valid after +.Fn m_cat +returns. +.Fn m_cat +does not update any packet header fields or free mbuf tags. +.\" +.It Fn m_catpkt m n +A variant of +.Fn m_cat +that operates on packets. +Both +.Fa m +and +.Fa n +must contain packet headers. +.Fa n +is not guaranteed to be valid after +.Fn m_catpkt +returns. .\" .It Fn m_split mbuf len how Partition an