[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: |
Wed, 25 Jan 2017 11:30:43 +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 #2, bug #50097 (project lwip):
Hm, one way would be to use static assertions to verify the size of structs in
the proto headers. E.g. have something like this:
#define STATIC_ASSERT(cond, name) typedef char assert_##name[(cond) ? 1 : -1]
struct foo_header { u16 a; u8 b; u8 c; u32 d; };
STATIC_ASSERT(sizeof(struct foo_header) == 8, foo_header_size);
Additionally, if struct packing is disabled there should be a check that
PBUF_LINK_HLEN (which includes ETH_PAD_SIZE) is a multiple of MEM_ALIGNMENT.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?50097>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #50097] Disabling struct packing should be official, Daniel Elstner, 2017/01/19
- [lwip-devel] [bug #50097] Disabling struct packing should be official, Simon Goldschmidt, 2017/01/25
- [lwip-devel] [bug #50097] Disabling struct packing should be official,
Daniel Elstner <=
- [lwip-devel] [bug #50097] Disabling struct packing should be official, Simon Goldschmidt, 2017/01/25
- [lwip-devel] [bug #50097] Disabling struct packing should be official, Daniel Elstner, 2017/01/26
- [lwip-devel] [bug #50097] Disabling struct packing should be official, Sylvain Rochet, 2017/01/26
- [lwip-devel] [bug #50097] Disabling struct packing should be official, Daniel Elstner, 2017/01/26
- [lwip-devel] [bug #50097] Disabling struct packing should be official, Sylvain Rochet, 2017/01/26
- [lwip-devel] [bug #50097] Disabling struct packing should be official, Simon Goldschmidt, 2017/01/26