lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] lwip_standard_chksum()


From: Christiaan Simons
Subject: [lwip-users] lwip_standard_chksum()
Date: Wed, 7 Dec 2005 20:30:49 +0100

Hi all,

It seems lwip_standard_chksum() from inet.c 1.22 and up
is disfunctional for the c16x and likely other 16 bit mcu's.

As far as I understand the problem is in that the source data
(void *dataptr ... ) can be at an odd (unaligned) address.

This was "solved" by a patch posted by Peter Jolasson
a few months ago and was partially committed by Leon.
(a crude/dubious runtime test for odd addresses was removed)

IMHO we need to change our reference implementation
to be correct for any architecture.

I've got some ideas:

* Add octets (byte-by-byte) instead of 16 bit words as shown in RFC1071 p5.
This will lower the performance for >8 bit architectures (a lot),
but will be alignment independant.

* Revert to the pre 1.22 routine, and enforce compile-time alignment by
changing
the function argument "void* dataptr" into "u16_t* dataptr" _and_ ensure
that  pbuf->payload pointers (all args passed to LWIP_CHKSUM) are aligned
to u16_t.

Anyone got another (better) idea?

Christiaan Simons

Hardware Engineer
Axon Digital Design

+31 (0)13 511 66 66
+31 (0)13 511 41 51

http://www.axon.tv



This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named.  If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.





reply via email to

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