svn commit: r296301 - head/share/man/man9

Mark Johnston markj at FreeBSD.org
Wed Mar 2 04:58:52 UTC 2016


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


More information about the svn-src-all mailing list