From: Justin Pettit Date: Mon, 21 Apr 2008 20:46:36 +0000 (-0700) Subject: Mark structures as packed that cause alignment problems on architectures like ARM. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95a73db4c2f724aa858923edc1b8161a15b13305;p=openvswitch Mark structures as packed that cause alignment problems on architectures like ARM. --- 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