c. if your hardware is not capable to do TCP offloading, then the LONG way is to start from beginning of packet to end of packet, and calculate checksum.
d. if u keep the previous checksum, ie (th->checksum=0 is not needed at all), and u know exactly which byte u modify, then just do a xor of the modified byte with the previous checksum, and u get the new checksum.....this is the preferred and fastest way.so in summary:th->check = 0;
th->check = csum_tcpudp_magic(iph->saddr, iph->daddr,
datalen, iph->protocol,
csum_partial((char *)th, datalen, 0));
skb->ip_summed = CHECKSUM_UNNECESSARY;
your setting of "0" above is correct, is because u want to calculate the checksum OVERALL....ie, packet start to packet end......demarcate correctly and u should get the answer....NOT csum_partial().....partial checksumming does not apply here.--
Regards,
Peter Teoh