>>>>> "Scott" == Scott Bambrough <[EMAIL PROTECTED]> writes:

 Scott> The following patches force structures to be packed on the
 Scott> ARM.  The structures ether_addr and ether_header in ethernet.h
 Scott> must be packed in order for tcpdump to function correctly.
 Scott> Actually tcpdump has its own version of these structures but
 Scott> the principle is the same.  Similarly the structure tftphdr
 Scott> must be packed or tftp and tftpd will not function correctly.

 Scott> The map structure in ksc5601 has a comment that states it
 Scott> should be packed in all architechures.  This is definitely not
 Scott> the case on the ARM.  The following submitted to the libc
 Scott> maintainers.  Ulrich is considering whether we need ARM
 Scott> specific headers.  One way or another it should be fixed soon
 Scott> in the CVS tree.

I assume by "...states it should be packed..." you meant that it
expects the structure to have no padding even though it was declared
without any specific attributes saying so.

If so... ARM is NOT the only platform where that assumption is false.
In fact, if you make that assumption the code is not ANSI C
compliant.  ANSI C says that structure members are aligned *at least*
to a multiple of their size.  Many platform align them exactly to that
minimum alignment, but ARM and i960, to mention two, put in additional 
padding.  The fact that most platforms use minimal padding is somewhat 
unfortunate, because it means this bug can go unnoticed for a while.

The safe way to get structures whose fields are exactly where you
planned them is to say "packed" explicitly.  That assumes, of course,
that you have a compiler that can be told such a thing.

        paul
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]

Reply via email to