problem with -mstructure-size-boundary=8 and network stack
mickd at goanna.iinet.net.au
Sun Apr 29 10:38:18 UTC 2012
You have to adjust the frames between your driver and the stack so that
the bytes after the ethernet header are word aligned.
The size of the ethernet header is better defined by ETHER_HDR_LEN,
there could be alignment bytes included when using sizeof( struct
ether_header ) that won't exist in the real data.
Check a few of the existing network drivers, there are examples for
We've run RTEMS using both minimum alignments without problem once we
got our network driver fixed for these.
On 29/04/12 17:02, JIANGJason wrote:
> HI all,
> I am working on a porting of RTEMS 4.10.2(tried 4.9.4 also) to a S3C2440/CS8900 based SBC, and with problem to let the network stack to work.
> (1) If -mstructure-size-boundary=8 is used, data abort will be occur at ip_input.c:400 (the problem code is listed below) when there is a IP packet incoming, such as ICMP, or any other. The
> if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr) goto ours;
> (1) If -mstructure-size-boundary=32 is used, any IP packet out send is in abnormal format. and wireshark told me that the packet it captured are all "Bogus IP header length (0, must be at least 20)".
> I am not familiar with the IP stack itself, but it looks can not be easily solved by just change the compiling options. Anyone had the same problem before?
> Best Regards, Jason
> rtems-users mailing list
> rtems-users at rtems.org
Goanna Technologies Pty Ltd
+61 8 9444 2634
More information about the users