Re: mbuf w/o pkthdr?

From: Giorgos Keramidas <keramida_at_freebsd.org>
Date: Tue, 12 Oct 2004 18:57:40 +0300
On 2004-10-12 17:36, Dag-Erling Sm?rgrav <des_at_des.no> wrote:
> Sam <sah_at_softcardsystems.com> writes:
> > Are all packets supposed to have the M_PKTHDR flag?  Why?
>
> IIRC, M_PKTHDR indicates the first mbuf in a chain when a packet is
> split across multiple mbufs.  This usually only happens for outgoing
> packets, where protocol headers are constructed in separate mbufs
> which are prepended to the chain as the packet moves down the stack.

AFAIK, all the packets have an M_PKTHDR in the first mbuf of their
chain.  The presence of an M_PKTHDR flag only means that the beginning
of the mbuf contains a (struct pkthdr) before the packet payload.

This is not related to the splitting of packets to multiple mbufs or
not, though.  A small packet might have an M_PKTHDR but still fit in
a single mbuf if its payload packet (including protocol headers and
data) is less than MHLEN bytes.
Received on Tue Oct 12 2004 - 13:57:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:16 UTC