Re: mbuf_outbound_finalize bug?
Re: mbuf_outbound_finalize bug?
- Subject: Re: mbuf_outbound_finalize bug?
- From: "Bhavesh Davda" <email@hidden>
- Date: Fri, 22 Dec 2006 10:21:46 -0800
Since your module is an interface filter, the field(s) in the header(s)
will be in network byte-order. All you need to do is to byte-swap
the length at all times assuming it is an IPv4 packet.
Okay. I'll treat this fact as an invariant. What will change is the
expectation in mbuf_outbound_finalize() that the IP length field
should be in host-byte-order.
Well, you are already requesting the stack to perform software checksum
calculation on the packet which includes the transport payload; in terms
of per-byte cost that is much more significant than traversing the mbuf
chain to safely obtain the 2-octets IP length in the header. :)
Good point.
the fix is already in order.
So just to be clear: even if I *always* byte-swap the IP length to
make it host-byte-order in my iff_output_func before calling
mbuf_outbound_finalize, it will work now (10.4.8) *and* in a future
kernel where mbuf_outbound_finalize and friends have been fixed?
In other words: how do I write code to figure out that the issue has
been fixed, and no byte-swapping is necessary any more?
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