lkml.org 
[lkml]   [1999]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [OFFTOPIC?] Re: 2.2.x kernels missend odd-sized ICMP packets
Date
Hello,

There is a bug in egcs (including 1.1.2), which is triggered on
little-endian targets with constructs like

short var = 0;
*((char *) &var) = value;

if var is stored in a register and optimization is enabled. Then not only the
lowpart of this register is changed, but the whole register.

The problem is fixed in recent snapshots of egcs.

A workaround for the checksum problem could be

if (nleft == 1) {
#if __BYTE_ORDER == __LITTLE_ENDIAN
sum += *(u_char *)w;
#else
*(u_char *)(&answer) = *(u_char *)w ;
sum += answer;
#endif
}

Lars

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.024 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site