Re: tcp checksum

Richard B. Johnson (root@chaos.analogic.com)
Mon, 29 Nov 1999 10:27:24 -0500 (EST)


On Mon, 29 Nov 1999 prakash@rnd.cts-corp.com wrote:

> Hi all,
>
> I am trying to understand how skb->csum is used to calculate the
> tcp checksum.
>
> My problem is re-calculate the tcp checksum, when i recieve the
> packet at the ip_rcv() function. I am trying to change the destination
> IP address and recalculate the tcp checksum for that.
>
> Can any help me out with this.
>
> bye,
> prakash
>

Set the current checksum to 0, and call this with 'sum' equal to 0.
It will return the checksum which you put into the current checksum.

This is in the kernel:
unsigned int csum_partial(const unsigned char buf, int len, unsigned int
sum);

Cheers,
Dick Johnson

Penguin : Linux version 2.3.13 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

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