summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2007-04-14 19:42:20 +0000
committerkmacy <kmacy@FreeBSD.org>2007-04-14 19:42:20 +0000
commit386fa3b37f80f6f88aea42952c395c34d11055b8 (patch)
tree3bf68571de337bf4ade1fdeff1b6d882ed30c421 /sys
parent550a575853b319eba36cfc266a3a4cf9602a8188 (diff)
downloadFreeBSD-src-386fa3b37f80f6f88aea42952c395c34d11055b8.zip
FreeBSD-src-386fa3b37f80f6f88aea42952c395c34d11055b8.tar.gz
pad out m_hdr to make pkthdr word-aligned
shuffle pkthdr.len so that pkthdr.header is aligned without compiler added padding Reviewed by: rwatson, andre, sam
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/mbuf.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index b9f1c18..58ad3a6 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -77,6 +77,12 @@ struct mb_args {
};
#endif /* _KERNEL */
+#if defined(__LP64__)
+#define M_HDR_PAD 6
+#else
+#define M_HDR_PAD 2
+#endif
+
/*
* Header present at the beginning of every mbuf.
*/
@@ -87,6 +93,7 @@ struct m_hdr {
int mh_len; /* amount of data in this mbuf */
int mh_flags; /* flags; see below */
short mh_type; /* type of data in this mbuf */
+ uint8_t pad[M_HDR_PAD];/* word align */
};
/*
@@ -105,9 +112,9 @@ struct m_tag {
*/
struct pkthdr {
struct ifnet *rcvif; /* rcv interface */
- int len; /* total packet length */
/* variables for ip and tcp reassembly */
void *header; /* pointer to packet header */
+ int len; /* total packet length */
/* variables for hardware checksum */
int csum_flags; /* flags regarding checksum */
int csum_data; /* data field used by csum routines */
OpenPOWER on IntegriCloud