From: assar Date: Sat, 10 Jun 2000 14:26:40 +0000 (+0000) Subject: add __attribute__ ((packed)). From cgd@netbsd.org (Chris G. Demetriou) X-Git-Tag: libpcap-0.6.1~158 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/a9727ab8a9f29b3e5dd453d784c576c76b015cd2 add __attribute__ ((packed)). From cgd@netbsd.org (Chris G. Demetriou) --- diff --git a/linux-include/netinet/if_ether.h b/linux-include/netinet/if_ether.h index 4148ab83..dd5044ab 100644 --- a/linux-include/netinet/if_ether.h +++ b/linux-include/netinet/if_ether.h @@ -40,7 +40,7 @@ */ struct ether_addr { u_char ether_addr_octet[6]; -}; +} __attribute__ ((packed)); /* * Structure of a 10Mb/s Ethernet header. @@ -49,7 +49,7 @@ struct ether_header { u_char ether_dhost[6]; u_char ether_shost[6]; u_short ether_type; -}; +} __attribute__ ((packed)); #define ETHERTYPE_PUP 0x0200 /* PUP protocol */ #define ETHERTYPE_IP 0x0800 /* IP protocol */ @@ -80,7 +80,7 @@ struct ether_arp { u_char arp_spa[4]; /* sender protocol address */ u_char arp_tha[6]; /* target hardware address */ u_char arp_tpa[4]; /* target protocol address */ -}; +} __attribute__ ((packed)); #define arp_hrd ea_hdr.ar_hrd #define arp_pro ea_hdr.ar_pro #define arp_hln ea_hdr.ar_hln diff --git a/linux-include/netinet/ip_var.h b/linux-include/netinet/ip_var.h index c528b62f..ce116518 100644 --- a/linux-include/netinet/ip_var.h +++ b/linux-include/netinet/ip_var.h @@ -45,7 +45,7 @@ struct ipovly { short ih_len; /* protocol length */ struct in_addr ih_src; /* source internet address */ struct in_addr ih_dst; /* destination internet address */ -}; +} __attribute__ ((packed)); /* * Ip reassembly queue structure. Each fragment @@ -61,7 +61,7 @@ struct ipq { struct ipasfrag *ipq_next,*ipq_prev; /* to ip headers of fragments */ struct in_addr ipq_src,ipq_dst; -}; +} __attribute__ ((packed)); /* * Ip header, when holding a fragment. @@ -88,7 +88,7 @@ struct ipasfrag { u_short ip_sum; struct ipasfrag *ipf_next; /* next fragment */ struct ipasfrag *ipf_prev; /* previous fragment */ -}; +} __attribute__ ((packed)); /* * Structure stored in mbuf in inpcb.ip_options