Patch of bug #8708 applied which should fix header alignment issues on 32-bit processors.

While this patch might need further clean-up, it is applied to make sure this gets attention.
This commit is contained in:
likewise
2004-04-28 00:26:35 +00:00
parent 7dc51270ee
commit 2db9551750
4 changed files with 52 additions and 13 deletions

View File

@@ -46,6 +46,18 @@ PACK_STRUCT_END
# include "arch/epstruct.h"
#endif
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
struct ip_addr2 {
PACK_STRUCT_FIELD(u16_t addrw[2]);
} PACK_STRUCT_STRUCT;
PACK_STRUCT_END
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/epstruct.h"
#endif
/* For compatibility with BSD code */
struct in_addr {
u32_t s_addr;

View File

@@ -33,6 +33,8 @@
#ifndef __NETIF_ETHARP_H__
#define __NETIF_ETHARP_H__
#define PAD_ETH_SIZE 2
#include "lwip/pbuf.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
@@ -49,6 +51,9 @@ PACK_STRUCT_END
PACK_STRUCT_BEGIN
struct eth_hdr {
#if PAD_ETH_SIZE
PACK_STRUCT_FIELD(u8_t padding[PAD_ETH_SIZE]);
#endif
PACK_STRUCT_FIELD(struct eth_addr dest);
PACK_STRUCT_FIELD(struct eth_addr src);
PACK_STRUCT_FIELD(u16_t type);
@@ -64,9 +69,9 @@ struct etharp_hdr {
PACK_STRUCT_FIELD(u16_t _hwlen_protolen);
PACK_STRUCT_FIELD(u16_t opcode);
PACK_STRUCT_FIELD(struct eth_addr shwaddr);
PACK_STRUCT_FIELD(struct ip_addr sipaddr);
PACK_STRUCT_FIELD(struct ip_addr2 sipaddr);
PACK_STRUCT_FIELD(struct eth_addr dhwaddr);
PACK_STRUCT_FIELD(struct ip_addr dipaddr);
PACK_STRUCT_FIELD(struct ip_addr2 dipaddr);
} PACK_STRUCT_STRUCT;
PACK_STRUCT_END