X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fethernet.h;h=cb9d5274e6dee0e29b2d7769f892aa61e92f67ac;hb=ce4d55b72fd4290d4710f10e755f6dd9ed039d88;hp=ddb0a7c676a10785c5c8b5e18432c1d21b79c678;hpb=0530bf8704f92e9741d969d6576bf8e2bbf026be;p=tinc diff --git a/src/ethernet.h b/src/ethernet.h index ddb0a7c6..cb9d5274 100644 --- a/src/ethernet.h +++ b/src/ethernet.h @@ -61,24 +61,23 @@ #endif #ifndef HAVE_STRUCT_ETHER_HEADER -struct ether_header { +PACKED(struct ether_header { uint8_t ether_dhost[ETH_ALEN]; uint8_t ether_shost[ETH_ALEN]; uint16_t ether_type; -}; +}); #endif STATIC_ASSERT(sizeof(struct ether_header) == 14, "ether_header has incorrect size"); #ifndef HAVE_STRUCT_ARPHDR -struct arphdr { +PACKED(struct arphdr { uint16_t ar_hrd; uint16_t ar_pro; uint8_t ar_hln; uint8_t ar_pln; uint16_t ar_op; -}; - +}); #define ARPOP_REQUEST 1 #define ARPOP_REPLY 2 #define ARPOP_RREQUEST 3 @@ -91,13 +90,13 @@ struct arphdr { STATIC_ASSERT(sizeof(struct arphdr) == 8, "arphdr has incorrect size"); #ifndef HAVE_STRUCT_ETHER_ARP -struct ether_arp { +PACKED(struct ether_arp { struct arphdr ea_hdr; uint8_t arp_sha[ETH_ALEN]; uint8_t arp_spa[4]; uint8_t arp_tha[ETH_ALEN]; uint8_t arp_tpa[4]; -}; +}); #define arp_hrd ea_hdr.ar_hrd #define arp_pro ea_hdr.ar_pro #define arp_hln ea_hdr.ar_hln