lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #50097] Disabling struct packing should be official


From: Daniel Elstner
Subject: [lwip-devel] [bug #50097] Disabling struct packing should be official
Date: Thu, 26 Jan 2017 12:35:17 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/55.0.2883.87 Chrome/55.0.2883.87 Safari/537.36

Follow-up Comment #4, bug #50097 (project lwip):

Yes, I know that it is about alignment. The struct size check was intended to
verify that the compiler did not insert any alignment padding. If you say
that's guaranteed up-front, then the problem becomes smaller.

The pbuf code actually verifies alignment already from what I have seen.
Specifically, memory is already allocated in such a way that the payload is
aligned to MEM_ALIGNMENT.

As far as I can tell, the code assumes that protocol headers are completely
contained within the first pbuf of a pbuf chain. Given that the packed structs
are all protocol headers, it seems to me that verifying the link header
padding is all that is needed to ensure that what follows is properly aligned.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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