Re: Networking: mbuf->m_hdr.mh_data doesn't include DLIL header?
Re: Networking: mbuf->m_hdr.mh_data doesn't include DLIL header?
- Subject: Re: Networking: mbuf->m_hdr.mh_data doesn't include DLIL header?
- From: Andrew Gallatin <email@hidden>
- Date: Tue, 19 Sep 2006 13:46:02 -0400 (EDT)
Michael Smith writes:
>
> On Sep 19, 2006, at 10:33 AM, Bhavesh Davda wrote:
>
> >> Will the following heuristic work consistently?
> >>
> >> if (mbuf_data(*packet) != mbuf_pktdat(*packet)) {
> >> // the ethernet drivers must have stripped the L2 header. Prepend it
> >> }
> >
> > I really meant to say:
> >
> > if (mbuf_data(*packet) != mbuf_datastart(*packet)) {
> > ...
> > }
>
> No; it assumes that the incoming packet was always received at the
> beginning of the mbuf/cluster/external buffer, and that's not a safe
> assumption.
>
As an example, many drivers start the reception of ethernet frames 2
bytes past the beginning of the mbuf/cluster/external buffer so that
the payload portions of the frame will be nicely aligned (2 + 14 = 16).
Drew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden