diff --git a/CHANGELOG b/CHANGELOG index bfe59281..26d49ecf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,11 @@ HISTORY ++ New features: + 2013-09-02: Simon Goldschmidt + * arch.h and many other files: added optional macros PACK_STRUCT_FLD_8() and + PACK_STRUCT_FLD_S() to prevent gcc 4 from warning about struct members that + do not need packing + 2013-08-19: Simon Goldschmidt * netif.h: bug #42998: made NETIF_MAX_HWADDR_LEN overridable for some special networks diff --git a/src/core/dns.c b/src/core/dns.c index 580fe906..dbef5ee8 100644 --- a/src/core/dns.c +++ b/src/core/dns.c @@ -152,8 +152,8 @@ PACK_STRUCT_BEGIN /** DNS message header */ struct dns_hdr { PACK_STRUCT_FIELD(u16_t id); - PACK_STRUCT_FIELD(u8_t flags1); - PACK_STRUCT_FIELD(u8_t flags2); + PACK_STRUCT_FLD_8(u8_t flags1); + PACK_STRUCT_FLD_8(u8_t flags2); PACK_STRUCT_FIELD(u16_t numquestions); PACK_STRUCT_FIELD(u16_t numanswers); PACK_STRUCT_FIELD(u16_t numauthrr); diff --git a/src/core/ipv4/igmp.c b/src/core/ipv4/igmp.c index 6db7f913..1708f619 100644 --- a/src/core/ipv4/igmp.c +++ b/src/core/ipv4/igmp.c @@ -124,10 +124,10 @@ Steve Reynolds #endif PACK_STRUCT_BEGIN struct igmp_msg { - PACK_STRUCT_FIELD(u8_t igmp_msgtype); - PACK_STRUCT_FIELD(u8_t igmp_maxresp); - PACK_STRUCT_FIELD(u16_t igmp_checksum); - PACK_STRUCT_FIELD(ip_addr_p_t igmp_group_address); + PACK_STRUCT_FLD_8(u8_t igmp_msgtype); + PACK_STRUCT_FLD_8(u8_t igmp_maxresp); + PACK_STRUCT_FIELD(u16_t igmp_checksum); + PACK_STRUCT_FLD_S(ip_addr_p_t igmp_group_address); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES diff --git a/src/core/ipv6/ethip6.c b/src/core/ipv6/ethip6.c index ab9783a0..d9ac30f6 100644 --- a/src/core/ipv6/ethip6.c +++ b/src/core/ipv6/ethip6.c @@ -62,7 +62,7 @@ #endif PACK_STRUCT_BEGIN struct eth_addr { - PACK_STRUCT_FIELD(u8_t addr[6]); + PACK_STRUCT_FLD_8(u8_t addr[6]); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES @@ -76,10 +76,10 @@ PACK_STRUCT_END PACK_STRUCT_BEGIN struct eth_hdr { #if ETH_PAD_SIZE - PACK_STRUCT_FIELD(u8_t padding[ETH_PAD_SIZE]); + PACK_STRUCT_FLD_8(u8_t padding[ETH_PAD_SIZE]); #endif - PACK_STRUCT_FIELD(struct eth_addr dest); - PACK_STRUCT_FIELD(struct eth_addr src); + PACK_STRUCT_FLD_S(struct eth_addr dest); + PACK_STRUCT_FLD_S(struct eth_addr src); PACK_STRUCT_FIELD(u16_t type); } PACK_STRUCT_STRUCT; PACK_STRUCT_END diff --git a/src/include/lwip/arch.h b/src/include/lwip/arch.h index d655d14c..083a9dc5 100644 --- a/src/include/lwip/arch.h +++ b/src/include/lwip/arch.h @@ -68,6 +68,18 @@ extern "C" { #define PACK_STRUCT_FIELD(x) x #endif /* PACK_STRUCT_FIELD */ +/* Used for struct fields of u8_t, + * where some compilers warn that packing is not necessary */ +#ifndef PACK_STRUCT_FLD_8 +#define PACK_STRUCT_FLD_8(x) PACK_STRUCT_FIELD(x) +#endif /* PACK_STRUCT_FLD_8 */ + +/* Used for struct fields of that are packed structs themself, + * where some compilers warn that packing is not necessary */ +#ifndef PACK_STRUCT_FLD_S +#define PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x) +#endif /* PACK_STRUCT_FLD_S */ + #ifndef LWIP_UNUSED_ARG #define LWIP_UNUSED_ARG(x) (void)x diff --git a/src/include/lwip/dhcp.h b/src/include/lwip/dhcp.h index ca41eb04..db2f981c 100644 --- a/src/include/lwip/dhcp.h +++ b/src/include/lwip/dhcp.h @@ -73,20 +73,20 @@ PACK_STRUCT_BEGIN /** minimum set of fields of any DHCP message */ struct dhcp_msg { - PACK_STRUCT_FIELD(u8_t op); - PACK_STRUCT_FIELD(u8_t htype); - PACK_STRUCT_FIELD(u8_t hlen); - PACK_STRUCT_FIELD(u8_t hops); + PACK_STRUCT_FLD_8(u8_t op); + PACK_STRUCT_FLD_8(u8_t htype); + PACK_STRUCT_FLD_8(u8_t hlen); + PACK_STRUCT_FLD_8(u8_t hops); PACK_STRUCT_FIELD(u32_t xid); PACK_STRUCT_FIELD(u16_t secs); PACK_STRUCT_FIELD(u16_t flags); - PACK_STRUCT_FIELD(ip_addr_p_t ciaddr); - PACK_STRUCT_FIELD(ip_addr_p_t yiaddr); - PACK_STRUCT_FIELD(ip_addr_p_t siaddr); - PACK_STRUCT_FIELD(ip_addr_p_t giaddr); - PACK_STRUCT_FIELD(u8_t chaddr[DHCP_CHADDR_LEN]); - PACK_STRUCT_FIELD(u8_t sname[DHCP_SNAME_LEN]); - PACK_STRUCT_FIELD(u8_t file[DHCP_FILE_LEN]); + PACK_STRUCT_FLD_S(ip_addr_p_t ciaddr); + PACK_STRUCT_FLD_S(ip_addr_p_t yiaddr); + PACK_STRUCT_FLD_S(ip_addr_p_t siaddr); + PACK_STRUCT_FLD_S(ip_addr_p_t giaddr); + PACK_STRUCT_FLD_8(u8_t chaddr[DHCP_CHADDR_LEN]); + PACK_STRUCT_FLD_8(u8_t sname[DHCP_SNAME_LEN]); + PACK_STRUCT_FLD_8(u8_t file[DHCP_FILE_LEN]); PACK_STRUCT_FIELD(u32_t cookie); #define DHCP_MIN_OPTIONS_LEN 68U /** make sure user does not configure this too small */ @@ -98,7 +98,7 @@ struct dhcp_msg /** set this to be sufficient for your options in outgoing DHCP msgs */ # define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN #endif - PACK_STRUCT_FIELD(u8_t options[DHCP_OPTIONS_LEN]); + PACK_STRUCT_FLD_8(u8_t options[DHCP_OPTIONS_LEN]); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES diff --git a/src/include/lwip/icmp.h b/src/include/lwip/icmp.h index 85a0a352..4366901e 100644 --- a/src/include/lwip/icmp.h +++ b/src/include/lwip/icmp.h @@ -81,8 +81,8 @@ enum icmp_te_type { */ PACK_STRUCT_BEGIN struct icmp_echo_hdr { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); PACK_STRUCT_FIELD(u16_t chksum); PACK_STRUCT_FIELD(u16_t id); PACK_STRUCT_FIELD(u16_t seqno); diff --git a/src/include/lwip/icmp6.h b/src/include/lwip/icmp6.h index 9db1ca2d..9d57103f 100644 --- a/src/include/lwip/icmp6.h +++ b/src/include/lwip/icmp6.h @@ -105,8 +105,8 @@ enum icmp6_pp_code { #endif PACK_STRUCT_BEGIN struct icmp6_hdr { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); PACK_STRUCT_FIELD(u16_t chksum); PACK_STRUCT_FIELD(u32_t data); } PACK_STRUCT_STRUCT; @@ -121,8 +121,8 @@ PACK_STRUCT_END #endif PACK_STRUCT_BEGIN struct icmp6_echo_hdr { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); PACK_STRUCT_FIELD(u16_t chksum); PACK_STRUCT_FIELD(u16_t id); PACK_STRUCT_FIELD(u16_t seqno); diff --git a/src/include/lwip/ip4.h b/src/include/lwip/ip4.h index 19ca66fb..5fc7f81f 100644 --- a/src/include/lwip/ip4.h +++ b/src/include/lwip/ip4.h @@ -63,9 +63,9 @@ extern "C" { PACK_STRUCT_BEGIN struct ip_hdr { /* version / header length */ - PACK_STRUCT_FIELD(u8_t _v_hl); + PACK_STRUCT_FLD_8(u8_t _v_hl); /* type of service */ - PACK_STRUCT_FIELD(u8_t _tos); + PACK_STRUCT_FLD_8(u8_t _tos); /* total length */ PACK_STRUCT_FIELD(u16_t _len); /* identification */ @@ -77,14 +77,14 @@ struct ip_hdr { #define IP_MF 0x2000U /* more fragments flag */ #define IP_OFFMASK 0x1fffU /* mask for fragmenting bits */ /* time to live */ - PACK_STRUCT_FIELD(u8_t _ttl); + PACK_STRUCT_FLD_8(u8_t _ttl); /* protocol*/ - PACK_STRUCT_FIELD(u8_t _proto); + PACK_STRUCT_FLD_8(u8_t _proto); /* checksum */ PACK_STRUCT_FIELD(u16_t _chksum); /* source and destination IP addresses */ - PACK_STRUCT_FIELD(ip_addr_p_t src); - PACK_STRUCT_FIELD(ip_addr_p_t dest); + PACK_STRUCT_FLD_S(ip_addr_p_t src); + PACK_STRUCT_FLD_S(ip_addr_p_t dest); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES diff --git a/src/include/lwip/ip6.h b/src/include/lwip/ip6.h index a5c599c4..f76354ee 100644 --- a/src/include/lwip/ip6.h +++ b/src/include/lwip/ip6.h @@ -81,12 +81,12 @@ struct ip6_hdr { /* payload length */ PACK_STRUCT_FIELD(u16_t _plen); /* next header */ - PACK_STRUCT_FIELD(u8_t _nexth); + PACK_STRUCT_FLD_8(u8_t _nexth); /* hop limit */ - PACK_STRUCT_FIELD(u8_t _hoplim); + PACK_STRUCT_FLD_8(u8_t _hoplim); /* source and destination IP addresses */ - PACK_STRUCT_FIELD(ip6_addr_p_t src); - PACK_STRUCT_FIELD(ip6_addr_p_t dest); + PACK_STRUCT_FLD_S(ip6_addr_p_t src); + PACK_STRUCT_FLD_S(ip6_addr_p_t dest); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES @@ -105,19 +105,19 @@ PACK_STRUCT_END PACK_STRUCT_BEGIN struct ip6_hbh_hdr { /* next header */ - PACK_STRUCT_FIELD(u8_t _nexth); + PACK_STRUCT_FLD_8(u8_t _nexth); /* header length */ - PACK_STRUCT_FIELD(u8_t _hlen); + PACK_STRUCT_FLD_8(u8_t _hlen); /* router alert option type */ - PACK_STRUCT_FIELD(u8_t _ra_opt_type); + PACK_STRUCT_FLD_8(u8_t _ra_opt_type); /* router alert option data len */ - PACK_STRUCT_FIELD(u8_t _ra_opt_dlen); + PACK_STRUCT_FLD_8(u8_t _ra_opt_dlen); /* router alert option data */ PACK_STRUCT_FIELD(u16_t _ra_opt_data); /* PadN option type */ - PACK_STRUCT_FIELD(u8_t _padn_opt_type); + PACK_STRUCT_FLD_8(u8_t _padn_opt_type); /* PadN option data len */ - PACK_STRUCT_FIELD(u8_t _padn_opt_dlen); + PACK_STRUCT_FLD_8(u8_t _padn_opt_dlen); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES @@ -134,9 +134,9 @@ PACK_STRUCT_END PACK_STRUCT_BEGIN struct ip6_frag_hdr { /* next header */ - PACK_STRUCT_FIELD(u8_t _nexth); + PACK_STRUCT_FLD_8(u8_t _nexth); /* reserved */ - PACK_STRUCT_FIELD(u8_t reserved); + PACK_STRUCT_FLD_8(u8_t reserved); /* fragment offset */ PACK_STRUCT_FIELD(u16_t _fragment_offset); /* fragmented packet identification */ diff --git a/src/include/lwip/mld6.h b/src/include/lwip/mld6.h index a8f42e52..f629c3db 100644 --- a/src/include/lwip/mld6.h +++ b/src/include/lwip/mld6.h @@ -78,12 +78,12 @@ struct mld_group { #endif PACK_STRUCT_BEGIN struct mld_header { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); PACK_STRUCT_FIELD(u16_t chksum); PACK_STRUCT_FIELD(u16_t max_resp_delay); PACK_STRUCT_FIELD(u16_t reserved); - PACK_STRUCT_FIELD(ip6_addr_p_t multicast_address); + PACK_STRUCT_FLD_S(ip6_addr_p_t multicast_address); /* Options follow. */ } PACK_STRUCT_STRUCT; PACK_STRUCT_END diff --git a/src/include/lwip/nd6.h b/src/include/lwip/nd6.h index 916e2f54..2a8401fc 100644 --- a/src/include/lwip/nd6.h +++ b/src/include/lwip/nd6.h @@ -132,11 +132,11 @@ struct nd6_q_entry { #endif PACK_STRUCT_BEGIN struct ns_header { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); PACK_STRUCT_FIELD(u16_t chksum); PACK_STRUCT_FIELD(u32_t reserved); - PACK_STRUCT_FIELD(ip6_addr_p_t target_address); + PACK_STRUCT_FLD_S(ip6_addr_p_t target_address); /* Options follow. */ } PACK_STRUCT_STRUCT; PACK_STRUCT_END @@ -150,12 +150,12 @@ PACK_STRUCT_END #endif PACK_STRUCT_BEGIN struct na_header { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u8_t flags); - PACK_STRUCT_FIELD(u8_t reserved[3]); - PACK_STRUCT_FIELD(ip6_addr_p_t target_address); + PACK_STRUCT_FLD_8(u8_t flags); + PACK_STRUCT_FLD_8(u8_t reserved[3]); + PACK_STRUCT_FLD_S(ip6_addr_p_t target_address); /* Options follow. */ } PACK_STRUCT_STRUCT; PACK_STRUCT_END @@ -172,8 +172,8 @@ PACK_STRUCT_END #endif PACK_STRUCT_BEGIN struct rs_header { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); PACK_STRUCT_FIELD(u16_t chksum); PACK_STRUCT_FIELD(u32_t reserved); /* Options follow. */ @@ -197,11 +197,11 @@ PACK_STRUCT_END #endif PACK_STRUCT_BEGIN struct ra_header { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u8_t current_hop_limit); - PACK_STRUCT_FIELD(u8_t flags); + PACK_STRUCT_FLD_8(u8_t current_hop_limit); + PACK_STRUCT_FLD_8(u8_t flags); PACK_STRUCT_FIELD(u16_t router_lifetime); PACK_STRUCT_FIELD(u32_t reachable_time); PACK_STRUCT_FIELD(u32_t retrans_timer); @@ -218,12 +218,12 @@ PACK_STRUCT_END #endif PACK_STRUCT_BEGIN struct redirect_header { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t code); PACK_STRUCT_FIELD(u16_t chksum); PACK_STRUCT_FIELD(u32_t reserved); - PACK_STRUCT_FIELD(ip6_addr_p_t target_address); - PACK_STRUCT_FIELD(ip6_addr_p_t destination_address); + PACK_STRUCT_FLD_S(ip6_addr_p_t target_address); + PACK_STRUCT_FLD_S(ip6_addr_p_t destination_address); /* Options follow. */ } PACK_STRUCT_STRUCT; PACK_STRUCT_END @@ -239,9 +239,9 @@ PACK_STRUCT_END #endif PACK_STRUCT_BEGIN struct lladdr_option { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t length); - PACK_STRUCT_FIELD(u8_t addr[NETIF_MAX_HWADDR_LEN]); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FLD_8(u8_t addr[NETIF_MAX_HWADDR_LEN]); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES @@ -259,15 +259,15 @@ PACK_STRUCT_END #endif PACK_STRUCT_BEGIN struct prefix_option { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t length); - PACK_STRUCT_FIELD(u8_t prefix_length); - PACK_STRUCT_FIELD(u8_t flags); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FLD_8(u8_t prefix_length); + PACK_STRUCT_FLD_8(u8_t flags); PACK_STRUCT_FIELD(u32_t valid_lifetime); PACK_STRUCT_FIELD(u32_t preferred_lifetime); - PACK_STRUCT_FIELD(u8_t reserved2[3]); - PACK_STRUCT_FIELD(u8_t site_prefix_length); - PACK_STRUCT_FIELD(ip6_addr_p_t prefix); + PACK_STRUCT_FLD_8(u8_t reserved2[3]); + PACK_STRUCT_FLD_8(u8_t site_prefix_length); + PACK_STRUCT_FLD_S(ip6_addr_p_t prefix); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES @@ -281,11 +281,11 @@ PACK_STRUCT_END #endif PACK_STRUCT_BEGIN struct redirected_header_option { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t length); - PACK_STRUCT_FIELD(u8_t reserved[6]); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FLD_8(u8_t reserved[6]); /* Portion of redirected packet follows. */ - /* PACK_STRUCT_FIELD(u8_t redirected[8]); */ + /* PACK_STRUCT_FLD_8(u8_t redirected[8]); */ } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES @@ -299,8 +299,8 @@ PACK_STRUCT_END #endif PACK_STRUCT_BEGIN struct mtu_option { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t length); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); PACK_STRUCT_FIELD(u16_t reserved); PACK_STRUCT_FIELD(u32_t mtu); } PACK_STRUCT_STRUCT; @@ -316,12 +316,12 @@ PACK_STRUCT_END #endif PACK_STRUCT_BEGIN struct route_option { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t length); - PACK_STRUCT_FIELD(u8_t prefix_length); - PACK_STRUCT_FIELD(u8_t preference); + PACK_STRUCT_FLD_8(u8_t type); + PACK_STRUCT_FLD_8(u8_t length); + PACK_STRUCT_FLD_8(u8_t prefix_length); + PACK_STRUCT_FLD_8(u8_t preference); PACK_STRUCT_FIELD(u32_t route_lifetime); - PACK_STRUCT_FIELD(ip6_addr_p_t prefix); + PACK_STRUCT_FLD_S(ip6_addr_p_t prefix); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES diff --git a/src/include/netif/etharp.h b/src/include/netif/etharp.h index 9dd26fa9..0d50a595 100644 --- a/src/include/netif/etharp.h +++ b/src/include/netif/etharp.h @@ -57,7 +57,7 @@ extern "C" { #endif PACK_STRUCT_BEGIN struct eth_addr { - PACK_STRUCT_FIELD(u8_t addr[ETHARP_HWADDR_LEN]); + PACK_STRUCT_FLD_8(u8_t addr[ETHARP_HWADDR_LEN]); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES @@ -71,10 +71,10 @@ PACK_STRUCT_BEGIN /** Ethernet header */ struct eth_hdr { #if ETH_PAD_SIZE - PACK_STRUCT_FIELD(u8_t padding[ETH_PAD_SIZE]); + PACK_STRUCT_FLD_8(u8_t padding[ETH_PAD_SIZE]); #endif - PACK_STRUCT_FIELD(struct eth_addr dest); - PACK_STRUCT_FIELD(struct eth_addr src); + PACK_STRUCT_FLD_S(struct eth_addr dest); + PACK_STRUCT_FLD_S(struct eth_addr src); PACK_STRUCT_FIELD(u16_t type); } PACK_STRUCT_STRUCT; PACK_STRUCT_END @@ -115,13 +115,13 @@ PACK_STRUCT_BEGIN struct etharp_hdr { PACK_STRUCT_FIELD(u16_t hwtype); PACK_STRUCT_FIELD(u16_t proto); - PACK_STRUCT_FIELD(u8_t hwlen); - PACK_STRUCT_FIELD(u8_t protolen); + PACK_STRUCT_FLD_8(u8_t hwlen); + PACK_STRUCT_FLD_8(u8_t protolen); PACK_STRUCT_FIELD(u16_t opcode); - PACK_STRUCT_FIELD(struct eth_addr shwaddr); - PACK_STRUCT_FIELD(struct ip_addr2 sipaddr); - PACK_STRUCT_FIELD(struct eth_addr dhwaddr); - PACK_STRUCT_FIELD(struct ip_addr2 dipaddr); + PACK_STRUCT_FLD_S(struct eth_addr shwaddr); + PACK_STRUCT_FLD_S(struct ip_addr2 sipaddr); + PACK_STRUCT_FLD_S(struct eth_addr dhwaddr); + PACK_STRUCT_FLD_S(struct ip_addr2 dipaddr); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES diff --git a/src/include/netif/ppp/pppoe.h b/src/include/netif/ppp/pppoe.h index 2fbe3115..eae032c3 100644 --- a/src/include/netif/ppp/pppoe.h +++ b/src/include/netif/ppp/pppoe.h @@ -81,8 +81,8 @@ #endif PACK_STRUCT_BEGIN struct pppoehdr { - PACK_STRUCT_FIELD(u8_t vertype); - PACK_STRUCT_FIELD(u8_t code); + PACK_STRUCT_FLD_8(u8_t vertype); + PACK_STRUCT_FLD_8(u8_t code); PACK_STRUCT_FIELD(u16_t session); PACK_STRUCT_FIELD(u16_t plen); } PACK_STRUCT_STRUCT;