Messages in this thread | | | From | Lars Heete <> | Subject | Re: [OFFTOPIC?] Re: 2.2.x kernels missend odd-sized ICMP packets | Date | Mon, 12 Apr 1999 07:21:16 +0200 |
| |
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/
| |