lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Checksum problem with lwip_chksum()


From: John Taylor
Subject: RE: [lwip-users] Checksum problem with lwip_chksum()
Date: Thu, 2 Sep 2004 07:48:34 -0400

> Can you post your code?
Here is may hack.  I do not how efficient it is with respect to a true
byte oriented checksum - but it was a quick fix.

In lwip_chksum(), in the for loop - replace: 

        acc = acc + *((u16_t *)dataptr)++;

with
        /* !srt: read buffer byte-wise to resolve alignment issues! */
     *((u8_t*)(&temp)+0) = *((u8_t*)dataptr);
     *((u8_t*)(&temp)+1) = *((u8_t*)dataptr+1);
      acc += temp;

where 'temp' is a local variable declared as:

        volatile u16_t temp; /* !srt: work var for intermediate value */


-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of Paul C
Sent: Thursday, September 02, 2004 7:34 AM
To: Mailing list for lwIP users; Mailing list for lwIP users
Subject: Re: [lwip-users] Checksum problem with lwip_chksum()

I have always used tcp_write( ...,1);
Now I look back at lwip_chksum() I remember finding 
the same issue. As the copy function aligns the 
data I decided that was easiest to copy all data.

Can you post your code?

Paul



On Thu, 2 Sep 2004 11:33:12 +0100, "Chris WIlliams"
<address@hidden> said:
> 
> Has anybody else seen this problem? Is it a particular problem of the
H8
> (Paul C, did you have any problem here?). Would anybody like me to
post
> my new code?
> 
> Chris.


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users






reply via email to

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