Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Oct 2004 18:57:40 +0300
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        Dag-Erling Sm?rgrav <des@des.no>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: mbuf w/o pkthdr?
Message-ID:  <20041012155740.GA1648@orion.daedalusnetworks.priv>
In-Reply-To: <xzpy8ict0cy.fsf@dwp.des.no>
References:  <Pine.LNX.4.60.0410121115430.30953@athena> <xzpy8ict0cy.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2004-10-12 17:36, Dag-Erling Sm?rgrav <des@des.no> wrote:
> Sam <sah@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041012155740.GA1648>