Messages in this thread |  | | Date | Mon, 21 Aug 2000 13:25:12 +1000 | From | Mark James <> | Subject | Why 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/
|  |