From 95a73db4c2f724aa858923edc1b8161a15b13305 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Mon, 21 Apr 2008 13:46:36 -0700 Subject: [PATCH] Mark structures as packed that cause alignment problems on architectures like ARM. --- include/packets.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/packets.h b/include/packets.h index 78e2db07..ea30a2aa 100644 --- a/include/packets.h +++ b/include/packets.h @@ -73,7 +73,7 @@ struct eth_header { uint8_t eth_dst[ETH_ADDR_LEN]; uint8_t eth_src[ETH_ADDR_LEN]; uint16_t eth_type; -}; +} __attribute__((packed)); BUILD_ASSERT_DECL(ETH_HEADER_LEN == sizeof(struct eth_header)); #define LLC_DSAP_SNAP 0xaa @@ -85,7 +85,7 @@ struct llc_header { uint8_t llc_dsap; uint8_t llc_ssap; uint8_t llc_cntl; -}; +} __attribute__((packed)); BUILD_ASSERT_DECL(LLC_HEADER_LEN == sizeof(struct llc_header)); #define SNAP_ORG_ETHERNET "\0\0" /* The compiler adds a null byte, so @@ -101,7 +101,7 @@ BUILD_ASSERT_DECL(SNAP_HEADER_LEN == sizeof(struct snap_header)); struct llc_snap_header { struct llc_header llc; struct snap_header snap; -}; +} __attribute__((packed)); BUILD_ASSERT_DECL(LLC_SNAP_HEADER_LEN == sizeof(struct llc_snap_header)); #define VLAN_VID 0x0fff -- 2.30.2