Re: Upd checksum calculation
Re: Upd checksum calculation
- Subject: Re: Upd checksum calculation
- From: Josh Graessley <email@hidden>
- Date: Mon, 10 Oct 2005 16:20:48 -0700
The best way to do this right now is to calculate the checksum
yourself. There are various code snippets online for doing this.
There is an existing radar bug requesting that the kernel export a
function for calculating a checksum but such a function is not yet
available.
-josh
On Oct 10, 2005, at 4:15 PM, Allan Hoeltje wrote:
My kernel extension is passing IP/UDP packets up to a user agent.
The agent
does encryption on certain RTP packets and sends them back to the
kext to be
re-injected. That much is working just fine.
But sometimes I need to insert a special protocol packet in the
stream to
communicate with a sibling kernel extension on the remote machine.
I create
this IP/UDP packet from scratch (with the same source and
destination IP
addresses and same sport and dport port numbers as the other UDP
packets) in
the user agent and send it to the kext for injection.
My question is this: It is my understanding that if I set the IP
checksum
to 0 the kernel will calculate it. But what about the UPD
checksum? W. R.
Stevens says in vol. 1 that the UPD checksum is optional and should
be set
to 0 if you want it ignored. Then on the next page he hints you
should not
ignore it! The concept of checksum seems simple enough but
calculating the
UDP checksum is anything but simple.
Is there an easy way for my user agent application to calculate the
UDP
checksum? Alternatively, is there a way to make the kernel
calculate the
checksum at the point where I inject the packet?
I would love to ignore the UDP checksum but I've been told that
various
things in the cloud, like NAT, may drop UDP packets which do not
have a
checksum.
-Allan
_______________________________________________
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