* [PATCH] 2: 2.5.29-ether
@ 2002-08-03 18:16 Russell King
2002-08-04 0:10 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Russell King @ 2002-08-03 18:16 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel
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
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
@@ -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 */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-08-04 0:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-03 18:16 [PATCH] 2: 2.5.29-ether Russell King
2002-08-04 0:10 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®