2002-02-13 19:57:55

by Marek Zawadzki

[permalink] [raw]
Subject: Lost with UPD checksumming functions

Hello,

I am implementing a new transport protocol (basing on UDP
implementation) and I need to checksum every "datagram" I send
(using the same, TCP/UDP algorithm).

I am really lost in all those numerous checksumming functions in the
kernel and I'd like to know if there is any simple receipe to calculate
the checksum (I have the header, options and payload). I like the
function:

unsigned int csum_partial(const unsigned char * buff, int len, unsigned
int sum);

and I tried to call it aggainst my enitre (skb->data, skb->len, 0)
but the problem is it returns different value then the checkum calculated
by, say, UDP.
Please help.

-marek