lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Bug in inet_chksum_pseudo() produces bad checksum(Parad


From: David Empson
Subject: Re: [lwip-users] Bug in inet_chksum_pseudo() produces bad checksum(Paradigm C++)
Date: Mon, 27 Aug 2007 11:50:20 +1200

Dave Lyneham <address@hidden> wrote:
2.  Regarding the previous report, I found a message in the mail
archives subject "[lwip-users] [lwip] Bug in checksum routine + patch"
and the date was actually Wed, 08 Jan 2003.

Unfortunately that date doesn't narrow it down much. It looks like the mailing list archives were reorganised in early 2003, which resulted in all messages before then ending up with a date of 8 January 2003. That particular discussion actually took place in Feburary 2002 (given evidence in some quoted text).

I found it by searching for the subject in my local copy of the archives. It doesn't appear to be relevant to this problem. It is discussing data structure alignment issues with respect to the checksum routine.

For the Paradigm C++ issue, it looks like the compiler has a bug in its handling of a shift-right-16 operation on a 32-bit unsigned integer, resulting in an implied test for inequality to zero not working, but an explicit test is OK. (I can guess what the bug might be.)

If the expression "while ((acc >> 16) != 0)" fixes it then that is a reasonable solution to include in the LWIP standard distribution, with little or no overhead for anyone else (compared to the original expression).

Dave - you should look for any other places in the LWIP code where a similar test is being done. I suspect the bug will only happen in the case where an explicit shift-right-16 is done on a 32-bit expression, and there is an implied test for zero, i.e. something like "if (expr >> 16)" or "while (expr >> 16)".





reply via email to

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