Re: Networking: mbuf->m_hdr.mh_data doesn't include DLIL header?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Andrew Gallatin