Hey all,
I am trying to find how to calculate an entire new TCP checksum. My code now does not seem to be working correctly. Whenever a packet requires a TCP checksum it fails the TCP checksum.
I have found some other functions, but have not had much luck with any of them so far.
tcph: struct tcphdr
tcplen: skb->len - ip_hdrlen(skb)
iph: struct iphdr
Code:
tcph->check = 0;
tcph->check = tcp_v4_check(tcph, tcplen,
iph->saddr,
iph->daddr,
csum_partial((char *)tcph, tcplen, 0));