Re: mbuf_outbound_finalize() awkward on intel
Re: mbuf_outbound_finalize() awkward on intel
- Subject: Re: mbuf_outbound_finalize() awkward on intel
- From: Josh Graessley <email@hidden>
- Date: Mon, 9 Jan 2006 15:35:02 -0800
There were some fixes related to this that went in. It is possible
this is fixed. You should file a bug either way to make sure that
this is fixed. Ideally, everything in the packet that a kext sees
will be in network byte order and every function in the KPI should
take packets that contain data in network byte order. Anything else
would be a huge mess.
Again please file a bug and test this on the latest release (I'm not
sure what's out right now).
-josh
On Jan 9, 2006, at 2:23 PM, Andrew Gallatin wrote:
I'm running 8.3.0 on x86 (plain Darwin, not an Intel Mac).
I ported some driver code from ppc, and noticed that
packets where I had called mbuf_outbound_finalize()
resulted in kernel error messages:
cksum: out of data
This is because by the time a packet gets to a driver, the
ip->ip_len ends up in network byte order. In order to
use mbuf_outbound_finalize() on intel, I needed to byteswap
ip->ip_len. Eg:
ip = (struct ip *)((char *)mbuf_data(m_head) + ETHER_HDR_LEN);
ip->ip_len = ntohs(ip->ip_len);
mbuf_outbound_finalize(m_head, PF_INET, ETHER_HDR_LEN);
ip->ip_len = htons(ip->ip_len);
This is just a heads up for the next guy who runs into this..
Drew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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