2: 2.5.29-ether
PATCH 1/1 2: 2.5.29-ether
This patch has been verified to apply cleanly to 2.5.30
Some compilers may add extra padding at the end of struct ethhdr. This patch ensures that sizeof(struct ethhdr) always packed, and returns the expected size of 14 bytes.
This is particularly important when struct ethhdr is embedded into a structure, thusly:
struct arc_eth_encap
{
uint8_t proto; /* Always ARC_P_ETHER */
struct ethhdr eth; /* standard ethernet header (yuck!) */
uint8_t payload[0]; /* 493 bytes */};
#define ETH_ENCAP_HDR_SIZE 14
or this:
char *the_ip = (((char *)skb->data))
+ sizeof(struct ethhdr)
+ sizeof(struct arphdr) + ETH_ALEN;
include/linux/if_ether.h | 2 +- 1 files changed, 1 insertion, 1 deletion
include/linux/if_ether.h +1 -1
@@ -96,6 +96,6 @@unsigned char h_dest[ETH_ALEN ];/* destination eth addr */ unsigned char h_source[ETH_ALEN ];/* source ether addr */ unsigned short h_proto;/* packet type ID field */ -}; +} __attribute__((packed));#endif /* _LINUX_IF_ETHER_H */
David S. Miller
Applied From: Russell King <[email protected]>
Date: Sat, 03 Aug 2002 19:16:15 +0100
diff -urN orig/include/linux/if_ether.h linux/include/linux/if_ether.h
--- orig/include/linux/if_ether.h Mon Mar 11 11:56:23 2002
+++ linux/include/linux/if_ether.h Mon Mar 11 11:45:30 2002
Applied.