lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] Re: [patch #6760] Ping calculates incorrect checksum


From: Sprow
Subject: [lwip-devel] Re: [patch #6760] Ping calculates incorrect checksum
Date: Sun, 01 Mar 2009 17:52:30 +0000 (GMT)
User-agent: Pluto/2.04e (RISC-OS/4.02) POPstar/2.05

On 01 Mar, Simon Goldschmidt <address@hidden> wrote:
> Update of patch #6760 (project lwip):
>
> Fixed, thanks.

I'm not sure the patch, as checked in, works.

The problem is that callers to ping_prepare_echo already add on the
sizeof(icmp_echo_hdr) so there's no need to calculate data_len as it's known
at compile time.

Say PING_DATA_SIZE = 64, the ICMP header size is 20 bytes (or whatever it
is).

We used to do
 fill 20 byte header with stuff
 64 bytes of alphabet
 checksum 84 bytes

Now we do
 fill 20 byte header with stuff
 44 bytes of alphabet
 checksum 84 bytes still

Sprow.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]