lkml.org 
[lkml]   [2000]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectWhy is TCP checksum calc split between init & complete fns?
Hi,

I'm doing some work on TCP and can't work out why calcuation of the
TCP checksum is split between tcp_v4_checksum_init (net/ipv4/tcp_ipv4.c)
and tcp_checksum_complete (net/ipv4/tcp.c), at least for packets >= 68
bytes (why this threshold?).

If I want to run a TCP checksum (pseudo header + TCP header + data)
independently of the current TCP code, should I just do:

tcp_v4_check( skb->h.th,skb->len,skb->nh.iph->saddr,skb->nh.iph->daddr,
csum_partial((char *)skb->h.th, skb->len, 0))
);

or do I need to call tcp_v4_checksum_init followed by tcp_checksum_complete?

Thanks -- Mark
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:37    [W:0.022 / U:3.660 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site