Hello Curt,

first look through the code, my brain triggered on something in memory that seemed to have survived time despite wear and beer:

lwip_standard_chksum2(void *dataptr, int len)
{
 u8_t *pb = dataptr;
 u16_t *ps, t = 0;
 u32_t sum = 0;
 int odd = ((u32_t)pb & 1);

 /* Get aligned to u16_t */
 if (odd && len > 0) {
   ((u8_t *)&t)[1] = *pb++;
This fetches a 16-bit word, possible on a non-16 bit aligned address. Some CPU's will puke at this point and stop execution. I wish I could name a few CPUs with 100% certainty but I cannot now, though I am sure have come across this on some 16 and 32-bit platforms.

What should be done here is fetch a 8-bit number on a 8-bit aligned address (which is always the case :-)).

Regards,

Leon.




_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to