Upd checksum calculation
Upd checksum calculation
- Subject: Upd checksum calculation
- From: Allan Hoeltje <email@hidden>
- Date: Mon, 10 Oct 2005 16:15:51 -0700
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:
This email sent to email@hidden