<div dir="ltr">oh, thank you so much!!!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 11, 2014 at 4:19 PM, John de la Garza <span dir="ltr"><<a href="mailto:john@jjdev.com" target="_blank">john@jjdev.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tue, Feb 11, 2014 at 03:03:42PM -0500, Guibin(Bill) Tian wrote:<br>
> Hi,<br>
> I am looking for the code in linux kernel that verifies the checksum of TCP<br>
> header and IP header for inbound packet. The packet supposes to be dropped<br>
> if the checksum doesn't match.<br>
<br>
</div>Here is some code that checks the TCP checksum.<br>
<br>
/*<br>
* Calculate(/check) TCP checksum<br>
*/<br>
static inline __sum16 tcp_v4_check(int len, __be32 saddr,<br>
__be32 daddr, __wsum base)<br>
{<br>
return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base);<br>
}<br>
<br>
from: include/net/tcp.h<br>
<br>
<br>
also, try searching for csum_error in net/ipv4/tcp_ipv4.c<br>
</blockquote></div><br></div>