Quote:
Originally Posted by icortazar3
I am writing a Kernel Module (will become GPL when ended) to backup VANETS using Cellular Data Network (UMTS)
I'm using Netfilter hooks: The idea seems simple you put an OUTPUT hook and if the dest address is in a list of adrresses to be backuped, you change the dest address
Of course you have to recalculate
IP checksum: ip_send_ceck()
Route: ip_route_me_harder()
TCP/UDP checksums these are build using a fake header with ip addresses and ports. After changing an address you haye to call
ip_nat_cheat_check()
The problem is when my hook is called UDP checksum isnīt in place yet, I donīt know where it is calculated (I know that because I always get the same check value but my datagrams have an increasing order field)
Could any one help me?
|
I think I have resolved the problem.
It was related with TOE (Tcp offload engine) and you donīt really need to disable it. The only thing you have to do if you're going to mangle a packet is:
if(skb->ip_summed == CHECKSUM_HW)
skb_checksum_help(skb, 0);
Being skb a pointer to the "socket buffer" of the packet. This call will complete the checksum calculation.
Of course after mangling you have to call ip_send_check() , ip_route_me_harder() and ip_nat_cheat_check()
Cheers