lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t)


From: Bill Auerbach
Subject: [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t)
Date: Fri, 29 Jan 2010 14:32:48 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)

Follow-up Comment #9, bug #27352 (project lwip):

Which references?  References within a struct (ip_hdr) are correct because
that struct is packed and alignment unconstrained by its definition.  By
adding packing on it *outside* of a containing struct it forces the compiler
to treat it unaligned when it would never be (all variables of type ip_addr
will be aligned just like all char variables are aligned).

The point was, if the packet is aligned, so is ip_addr in the packet.  If
it's not aligned, it's still handled correctly because of the packing
requirement of ip_hdr.  ipHdr.src will work on any address because of packing
on ip_hdr.  I don't see the reason to pack something within a packed struct -
it already is treated packed this way, and when ip_addr is used outside of
ip_hdr, the packing causes unnecessary poor code generation?  Or I'm missing
your point?

Doesn't everyone using 32-bit aligned processors use ETH_PAD 2 to align
everything?

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27352>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]