From patchwork Thu Sep 8 14:51:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Flexible array should be last in struct mbuf Date: Thu, 08 Sep 2011 04:51:10 -0000 From: Elie Richa X-Patchwork-Id: 113906 Message-Id: <1315493470-32346-1-git-send-email-richa@adacore.com> To: qemu-devel@nongnu.org Cc: Elie Richa The flexible array member should remain the last member in the structure as this assumption is based upon in the code. Signed-off-by: Elie Richa --- slirp/mbuf.h | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/slirp/mbuf.h b/slirp/mbuf.h index 55170e5..e13ff71 100644 --- a/slirp/mbuf.h +++ b/slirp/mbuf.h @@ -82,12 +82,13 @@ struct m_hdr { struct mbuf { struct m_hdr m_hdr; Slirp *slirp; + bool arp_requested; + uint64_t expiration_date; union M_dat { char m_dat_[1]; /* ANSI don't like 0 sized arrays */ char *m_ext_; - } M_dat; - bool arp_requested; - uint64_t expiration_date; + } M_dat; /* This is a "flexible array member". It should always remain + the last member of the structure */ }; #define m_next m_hdr.mh_next