Re: mbuf_outbound_finalize bug?
Re: mbuf_outbound_finalize bug?
- Subject: Re: mbuf_outbound_finalize bug?
- From: "Bhavesh Davda" <email@hidden>
- Date: Wed, 20 Dec 2006 20:37:39 -0800
Thanks, Adi,
So how do I do the workaround (byte-swap ip->ip_len in iff_output_func
before calling mbuf_outbound_finalize, and then byte-swap it back), in
a "future proof" way, so I don't have to reverse this workaround when
Apple fixes the bug?
Or the fact that my NKE has to work on both older and newer kernels?
Thanks!
- Bhavesh
On 12/20/06, Adi Masputra <email@hidden> wrote:
On Dec 20, 2006, at 6:17 PM, Bhavesh Davda wrote:
> When calling mbuf_outbound_finalize() to compute the incomplete
> TCP/UDP checksums on the mbuf from my iff_output_func (interface
> filter output function), I kept getting messages from the kernel
> "cksum: out of data".
>
> Looking at the xnu-792.13.8 source, it looks like the underlying
> in_cksum_skip, called from in_delayed_cksum_offset, expects the ip_len
> field in the IP header to be in host-byte-order, while in reality the
> mbuf handed to my iff_output_func had the ip_len field in the IP
> header correctly populated in network-byte-order.
>
> What is my iff_output_func to do in such a situation?
This is a known bug and a fix is already in order. Assuming that
you call this from an interface filter, and that only the transport
checksum is to be recomputed, you should be able to byte-swap the
IP length, call mbuf_outbound_finalize() and restore the IP length
back to the network-byte order. If the driver offloads IP header
checksumming, and if this is an IPv4 packet, then you would need
to recompute the IP header checksum yourself prior to sending the
packet downstream. Once the fix is made available, you will no
longer need to do any of the above.
(Also note that this issue does not exist for PPC.)
Adi
>
> Thanks!
>
> --
> Bhavesh P. Davda
> _______________________________________________
> 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
_______________________________________________
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