diff options
| author | roy <roy@NetBSD.org> | 2021-02-03 05:51:40 +0000 |
|---|---|---|
| committer | roy <roy@NetBSD.org> | 2021-02-03 05:51:40 +0000 |
| commit | bc4ce66fe90fcf7976cc576b97ebcac59596ef86 (patch) | |
| tree | c65eff969fab11a3a3a334a123b32a56d7a407d2 /sys/netinet | |
| parent | 12465476cbdf6229f09f51b66bb809319c294ba8 (diff) | |
Remove __packed from various network structures
They are already network aligned and adding the __packed attribute
just causes needless compiler warnings about accssing members of packed
objects.
Diffstat (limited to 'sys/netinet')
| -rw-r--r-- | sys/netinet/if_ether.h | 4 | ||||
| -rw-r--r-- | sys/netinet/igmp.h | 4 | ||||
| -rw-r--r-- | sys/netinet/in.h | 4 | ||||
| -rw-r--r-- | sys/netinet/ip.h | 12 | ||||
| -rw-r--r-- | sys/netinet/ip6.h | 4 | ||||
| -rw-r--r-- | sys/netinet/ip_carp.h | 8 | ||||
| -rw-r--r-- | sys/netinet/ip_icmp.h | 24 | ||||
| -rw-r--r-- | sys/netinet/ip_mroute.h | 4 | ||||
| -rw-r--r-- | sys/netinet/ip_var.h | 4 | ||||
| -rw-r--r-- | sys/netinet/tcp.h | 4 | ||||
| -rw-r--r-- | sys/netinet/tcp_debug.h | 6 | ||||
| -rw-r--r-- | sys/netinet/tcp_var.h | 4 | ||||
| -rw-r--r-- | sys/netinet/udp.h | 4 | ||||
| -rw-r--r-- | sys/netinet/udp_var.h | 6 |
14 files changed, 48 insertions, 44 deletions
diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h index 985b277a513..de957b1bb82 100644 --- a/sys/netinet/if_ether.h +++ b/sys/netinet/if_ether.h @@ -1,4 +1,4 @@ -/* $NetBSD: if_ether.h,v 1.34 2007/12/25 18:33:46 perry Exp $ */ +/* $NetBSD: if_ether.h,v 1.35 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -75,7 +75,7 @@ struct ether_arp { u_int8_t arp_spa[4]; /* sender protocol address */ u_int8_t arp_tha[ETHER_ADDR_LEN]; /* target hardware address */ u_int8_t arp_tpa[4]; /* target protocol address */ -} __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/sys/netinet/igmp.h b/sys/netinet/igmp.h index a13056fe706..c55fd7e7a39 100644 --- a/sys/netinet/igmp.h +++ b/sys/netinet/igmp.h @@ -1,4 +1,4 @@ -/* $NetBSD: igmp.h,v 1.12 2014/05/29 23:02:48 rmind Exp $ */ +/* $NetBSD: igmp.h,v 1.13 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (c) 1992, 1993 @@ -88,7 +88,7 @@ struct igmp { uint8_t igmp_code; /* code for routing sub-messages */ uint16_t igmp_cksum; /* IP-style checksum */ struct in_addr igmp_group; /* group address being reported */ -} __packed; /* (zero for queries) */ +}; /* (zero for queries) */ #define IGMP_MINLEN 8 diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 010a073a9e7..80dc4f1bf3f 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -1,4 +1,4 @@ -/* $NetBSD: in.h,v 1.111 2020/09/08 14:12:57 christos Exp $ */ +/* $NetBSD: in.h,v 1.112 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -157,7 +157,7 @@ typedef __sa_family_t sa_family_t; */ struct in_addr { in_addr_t s_addr; -} __packed; +}; /* * Definitions of bits in internet address integers. diff --git a/sys/netinet/ip.h b/sys/netinet/ip.h index a1461075441..b5058537010 100644 --- a/sys/netinet/ip.h +++ b/sys/netinet/ip.h @@ -1,4 +1,4 @@ -/* $NetBSD: ip.h,v 1.35 2020/08/28 07:01:57 riastradh Exp $ */ +/* $NetBSD: ip.h,v 1.36 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -70,7 +70,7 @@ struct ip { u_int8_t ip_p; /* protocol */ u_int16_t ip_sum; /* checksum */ struct in_addr ip_src, ip_dst; /* source and dest address */ -} __packed; +}; #define IP_MAXPACKET 65535 /* maximum packet size */ #define IP_MINFRAGSIZE 69 /* minumum size that can be fraged */ @@ -207,9 +207,9 @@ struct ip_timestamp { struct ipt_ta { struct in_addr ipt_addr; n_time ipt_time; - } ipt_ta[1] __packed; - } ipt_timestamp __packed; -} __packed; + } ipt_ta[1]; + } ipt_timestamp; +}; /* flag bits for ipt_flg */ #define IPOPT_TS_TSONLY 0 /* timestamps only */ @@ -246,6 +246,6 @@ struct ippseudo { u_int8_t ippseudo_pad; /* pad, must be zero */ u_int8_t ippseudo_p; /* protocol */ u_int16_t ippseudo_len; /* protocol length */ -} __packed; +}; #endif /* !_NETINET_IP_H_ */ diff --git a/sys/netinet/ip6.h b/sys/netinet/ip6.h index 3072bf4f012..4bbd355d95a 100644 --- a/sys/netinet/ip6.h +++ b/sys/netinet/ip6.h @@ -1,4 +1,4 @@ -/* $NetBSD: ip6.h,v 1.26 2020/07/27 14:06:58 roy Exp $ */ +/* $NetBSD: ip6.h,v 1.27 2021/02/03 05:51:40 roy Exp $ */ /* $KAME: ip6.h,v 1.45 2003/06/05 04:46:38 keiichi Exp $ */ /* @@ -119,7 +119,7 @@ struct ip6_hdr_pseudo { u_int32_t ip6ph_len; u_int8_t ip6ph_zero[3]; u_int8_t ip6ph_nxt; -} __packed; +}; #endif /* diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h index 779caffd712..16594d9a433 100644 --- a/sys/netinet/ip_carp.h +++ b/sys/netinet/ip_carp.h @@ -1,4 +1,4 @@ -/* $NetBSD: ip_carp.h,v 1.12 2020/10/12 15:18:48 roy Exp $ */ +/* $NetBSD: ip_carp.h,v 1.13 2021/02/03 05:51:40 roy Exp $ */ /* $OpenBSD: ip_carp.h,v 1.18 2005/04/20 23:00:41 mpf Exp $ */ /* @@ -74,7 +74,11 @@ struct carp_header { u_int16_t carp_cksum; u_int32_t carp_counter[2]; unsigned char carp_md[20]; /* SHA1 HMAC */ -} __packed; +}; + +#ifdef CTASSERT +CTASSERT(sizeof(struct carp_header) == 36); +#endif #define CARP_DFLTTL 255 diff --git a/sys/netinet/ip_icmp.h b/sys/netinet/ip_icmp.h index e8429c79cf9..84a7889867c 100644 --- a/sys/netinet/ip_icmp.h +++ b/sys/netinet/ip_icmp.h @@ -1,4 +1,4 @@ -/* $NetBSD: ip_icmp.h,v 1.40 2018/09/14 05:09:51 maxv Exp $ */ +/* $NetBSD: ip_icmp.h,v 1.41 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -45,7 +45,7 @@ struct icmp_ra_addr { uint32_t ira_addr; uint32_t ira_preference; -} __packed; +}; /* * Structure of an icmp header. @@ -63,7 +63,7 @@ struct icmp { uint8_t iex_void1; uint8_t iex_length; uint16_t iex_void2; - } ih_exthdr __packed; + } ih_exthdr; /* ICMP_PARAMPROB */ uint8_t ih_pptr; @@ -75,21 +75,21 @@ struct icmp { struct ih_idseq { uint16_t icd_id; uint16_t icd_seq; - } ih_idseq __packed; + } ih_idseq; /* ICMP_UNREACH_NEEDFRAG (Path MTU Discovery, RFC1191) */ struct ih_pmtu { uint16_t ipm_void; uint16_t ipm_nextmtu; - } ih_pmtu __packed; + } ih_pmtu; /* ICMP_ROUTERADVERT */ struct ih_rtradv { uint8_t irt_num_addrs; uint8_t irt_wpa; uint16_t irt_lifetime; - } ih_rtradv __packed; - } icmp_hun /* XXX __packed ??? */; + } ih_rtradv; + } icmp_hun; #define icmp_pptr icmp_hun.ih_pptr #define icmp_gwaddr icmp_hun.ih_gwaddr @@ -108,12 +108,12 @@ struct icmp { uint32_t its_otime; uint32_t its_rtime; uint32_t its_ttime; - } id_ts __packed; + } id_ts; struct id_ip { struct ip idi_ip; /* options and then 64 bits of data */ - } id_ip /* XXX: __packed ??? */; + } id_ip; /* ICMP_ROUTERADVERT */ struct icmp_ra_addr id_radv; @@ -122,7 +122,7 @@ struct icmp { uint32_t id_mask; int8_t id_data[1]; - } icmp_dun /* XXX __packed ??? */; + } icmp_dun; #define icmp_otime icmp_dun.id_ts.its_otime #define icmp_rtime icmp_dun.id_ts.its_rtime @@ -149,7 +149,7 @@ struct icmp_ext_hdr { #endif uint8_t rsvd2; uint16_t checksum; -} __packed; +}; /* * ICMP Extension Object Header (RFC4884). @@ -158,7 +158,7 @@ struct icmp_ext_obj_hdr { uint16_t length; uint8_t class_num; uint8_t c_type; -} __packed; +}; /* * Lower bounds on packet lengths for various types. diff --git a/sys/netinet/ip_mroute.h b/sys/netinet/ip_mroute.h index 4531601b283..4edc3c82294 100644 --- a/sys/netinet/ip_mroute.h +++ b/sys/netinet/ip_mroute.h @@ -1,4 +1,4 @@ -/* $NetBSD: ip_mroute.h,v 1.32 2018/02/07 11:42:58 maxv Exp $ */ +/* $NetBSD: ip_mroute.h,v 1.33 2021/02/03 05:51:40 roy Exp $ */ #ifndef _NETINET_IP_MROUTE_H_ #define _NETINET_IP_MROUTE_H_ @@ -283,7 +283,7 @@ struct igmpmsg { u_int8_t im_vif; /* vif rec'd on */ u_int8_t unused3; struct in_addr im_src, im_dst; -} __packed; +}; /* * Argument structure used for pkt info. while upcall is made. diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index 9e1eccf2a74..351399527ca 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -1,4 +1,4 @@ -/* $NetBSD: ip_var.h,v 1.130 2020/08/28 06:31:42 ozaki-r Exp $ */ +/* $NetBSD: ip_var.h,v 1.131 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -46,7 +46,7 @@ struct ipovly { u_int16_t ih_len; /* protocol length */ struct in_addr ih_src; /* source internet address */ struct in_addr ih_dst; /* destination internet address */ -} __packed; +}; /* * IP Flow structure diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 203131f0163..7db2d1fb7a6 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -1,4 +1,4 @@ -/* $NetBSD: tcp.h,v 1.34 2019/11/01 13:54:59 christos Exp $ */ +/* $NetBSD: tcp.h,v 1.35 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -72,7 +72,7 @@ struct tcphdr { uint16_t th_win; /* window */ uint16_t th_sum; /* checksum */ uint16_t th_urp; /* urgent pointer */ -} __packed; +}; #define TCPOPT_EOL 0 #define TCPOLEN_EOL 1 diff --git a/sys/netinet/tcp_debug.h b/sys/netinet/tcp_debug.h index 7512217c02c..d2f3c150569 100644 --- a/sys/netinet/tcp_debug.h +++ b/sys/netinet/tcp_debug.h @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_debug.h,v 1.18 2018/05/01 07:03:33 maxv Exp $ */ +/* $NetBSD: tcp_debug.h,v 1.19 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -47,7 +47,7 @@ struct tcp_debug { struct { struct ip ip4; struct tcphdr th; - } __packed td_ti; + } td_ti; struct { #ifdef INET6 struct ip6_hdr ip6; @@ -60,7 +60,7 @@ struct tcp_debug { struct tcpcb td_cb; }; -#define TA_INPUT 0 +#define TA_INPUT 0 #define TA_OUTPUT 1 #define TA_USER 2 #define TA_RESPOND 3 diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 348ccace4f2..8fd2cc4bb7b 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_var.h,v 1.192 2020/03/05 15:18:55 riastradh Exp $ */ +/* $NetBSD: tcp_var.h,v 1.193 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -168,7 +168,7 @@ struct tcpiphdr { struct ipovly ti_i; /* overlaid ip structure */ struct tcphdr ti_t; /* tcp header */ -} __packed; +}; #define ti_x1 ti_i.ih_x1 #define ti_pr ti_i.ih_pr #define ti_len ti_i.ih_len diff --git a/sys/netinet/udp.h b/sys/netinet/udp.h index c8c10ecddcf..1bb0019b415 100644 --- a/sys/netinet/udp.h +++ b/sys/netinet/udp.h @@ -1,4 +1,4 @@ -/* $NetBSD: udp.h,v 1.16 2012/06/22 14:54:35 christos Exp $ */ +/* $NetBSD: udp.h,v 1.17 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -44,7 +44,7 @@ struct udphdr { uint16_t uh_dport; /* destination port */ uint16_t uh_ulen; /* udp length */ uint16_t uh_sum; /* udp checksum */ -} __packed; +}; /* socket options for UDP */ #define UDP_ENCAP 100 diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index d14458a4891..9e7001e35ff 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -1,4 +1,4 @@ -/* $NetBSD: udp_var.h,v 1.46 2020/08/20 21:21:32 riastradh Exp $ */ +/* $NetBSD: udp_var.h,v 1.47 2021/02/03 05:51:40 roy Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -38,9 +38,9 @@ * UDP kernel structures and variables. */ struct udpiphdr { - struct ipovly ui_i; /* overlaid ip structure */ + struct ipovly ui_i; /* overlaid ip structure */ struct udphdr ui_u; /* udp header */ -} __packed; +}; #define ui_x1 ui_i.ih_x1 #define ui_pr ui_i.ih_pr #define ui_len ui_i.ih_len |
