public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] IP_t should be a "packed" struct
@ 2009-01-27 18:32 Luigi 'Comio' Mantellini
  2009-01-28  9:42 ` Luigi 'Comio' Mantellini
  2009-01-28 17:55 ` Ben Warren
  0 siblings, 2 replies; 17+ messages in thread
From: Luigi 'Comio' Mantellini @ 2009-01-27 18:32 UTC (permalink / raw)
  To: u-boot

Hi ML,

I'm working on a mips target and I used qemu_mips target to simulate my target 
(that I hope to have in the next week...)

Following my activities I noticed that IP_t structure is no defined with 
attribute "packed". I noticed this issue because using a self-made toolchain 
(gcc4.2.4+binutils2.8+uclibc0.9.30) the compiler has aligned all bytes to 
32bit boundary. This is not ok, because the packets IP_t can be non aligned 
(see the /net/net.c PingSend function, for an example).

The dirty solution is to define the structure with the 
__attribute__((__packed__))... but, from my point of view, a better packet 
forging mechanism should be implemented into the net.c stack.

I attached a trivial patch that solved the issue on my target.

Any comments is welcome.

best regards,

luigi

-- 
Luigi Mantellini
R&D - Software
Industrie Dial Face S.p.A.
Via Canzo, 4
20068 Peschiera Borromeo (MI), Italy
Tel.:  +39 02 5167 2813
Fax:   +39 02 5167 2459
Email: luigi.mantellini at idf-hit.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: include_net_h.patch
Type: text/x-patch
Size: 419 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090127/68310d16/attachment.bin 

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-01-29 10:37 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-27 18:32 [U-Boot] IP_t should be a "packed" struct Luigi 'Comio' Mantellini
2009-01-28  9:42 ` Luigi 'Comio' Mantellini
2009-01-28 17:55 ` Ben Warren
2009-01-28 18:36   ` Jerry Van Baren
2009-01-28 18:58     ` Ben Warren
2009-01-28 20:40       ` Luigi Mantellini
2009-01-28 21:21         ` Ben Warren
2009-01-28 21:38           ` Wolfgang Denk
2009-01-28 21:52             ` Ben Warren
2009-01-28 22:21               ` Wolfgang Denk
2009-01-28 22:16             ` Luigi Mantellini
2009-01-28 22:27               ` Wolfgang Denk
2009-01-28 23:04                 ` Luigi Mantellini
2009-01-29 10:20                   ` Wolfgang Denk
2009-01-29 10:37                     ` Alessandro Rubini
2009-01-28 20:58   ` Luigi Mantellini
2009-01-28 21:26     ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox