Little Endian ARM fails on 1st TCP datagram

Gene Smith gds at chartertn.net
Mon Aug 18 03:49:49 UTC 2008


I am trying to bring up a new ARM bsp. ARP is working but when any TCP 
packet comes in it is dropped. With netdemo I see a TCP error:

"Bad offset in TCP header"

This is referring to the 4 bit header length field in the TCP header. 
Looking at the code with that parses this field, it either assumes big 
or little endian, depending on a BYTE_ORDER macro. It seems to be 
looking at it as big endian but my processor is definitely little.

I am not sure where this is actually set. Looking around, it seems to 
depend on a defined value __ARMEL__ or __ARMEB__ which I can't find 
defined anywhere in the RTEMS tree.

I did find a couple of mailing list threads that mention what seems like 
this problem, such as this:

http://www.rtems.com/ml/rtems-users/2005/february/msg00232.html

But it clains it is fixed in newlib-1.13 and rtems4.8 uses 1.15. So I am 
not sure if the problem has come back or was never really fixed or I am 
doing something else wrong.

-gene




More information about the users mailing list