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
This commit is contained in:
Mark Johnston 2016-03-02 04:58:51 +00:00
parent 429008a9ca
commit a3f6b02969
2 changed files with 24 additions and 7 deletions

View File

@ -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 \

View File

@ -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