summaryrefslogtreecommitdiffstats
path: root/sys/net/ethernet.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2006-12-01 07:06:35 +0000
committerimp <imp@FreeBSD.org>2006-12-01 07:06:35 +0000
commit5ba486ed0b42850539fa991d757bc7f0e53261d7 (patch)
treec9b9aac833be3430057db844e91aceacbe30c000 /sys/net/ethernet.h
parentb9438a66362d4965c5f8ff02e33ebce161002907 (diff)
downloadFreeBSD-src-5ba486ed0b42850539fa991d757bc7f0e53261d7.zip
FreeBSD-src-5ba486ed0b42850539fa991d757bc7f0e53261d7.tar.gz
Use CTASSERT to make sure:
sizeof ether_header is 2 * ETHER_ADDR_LEN + 2 (14) bytes long sizeof ether_addr is ETHER_ADDR_LEN bytes long On arm, this shows that struct ether_addr needs to be __packed. The first condition muts be true for the bridging code to not dump core. The second one appears to be implicitly relied upon by wi (but many of the rids it sends down likely need __packed too to be safe) and maybe others. It appears to not hurt anything.
Diffstat (limited to 'sys/net/ethernet.h')
-rw-r--r--sys/net/ethernet.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h
index 8d512c0..1b89416 100644
--- a/sys/net/ethernet.h
+++ b/sys/net/ethernet.h
@@ -68,7 +68,12 @@ struct ether_header {
*/
struct ether_addr {
u_char octet[ETHER_ADDR_LEN];
-};
+} __packed;
+
+#ifdef CTASSERT
+CTASSERT(sizeof (struct ether_header) == ETHER_ADDR_LEN * 2 + 2);
+CTASSERT(sizeof (struct ether_addr) == ETHER_ADDR_LEN);
+#endif
#define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */
OpenPOWER on IntegriCloud