lkml.org 
[lkml]   [2000]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Why is TCP checksum calc split between init & complete fns?
kuznet@ms2.inr.ac.ru wrote:

> > 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))
> > );
>
> Yes.

OK, thanks. If anyone out there knows, I'd still like to find out
why this is normally only done for TCP packets <= 68 bytes.


> > or do I need to call tcp_v4_checksum_init followed by tcp_checksum_complete?
>
> In no curcumstances. This function modify skb head.

Which function mods the head? As far as I can see, for big packets the
"init" function puts the pseudo-header checksum in skb->csum, while the
"complete" function (include/net/tcp.h not net/ipv4/tcp.c -- my apologies)
checks the rest of the packet. Why the split?

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:1.494 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site