summaryrefslogtreecommitdiff
path: root/include/linux/if_ether.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2004-10-18 18:03:51 -0700
committerGreg Kroah-Hartman <greg@kroah.com>2004-10-18 18:03:51 -0700
commitbffe01870598b7a0a77073e25ee94e026bc98e6b (patch)
treef5f5b65fec1239b18a4c2634807ff5d7e5729de9 /include/linux/if_ether.h
parent23aebb6f8755121394ef088d84a7fa483b444aa9 (diff)
parenta4946826c30c56a5830326552a395c5b6afc13ef (diff)
merge
Diffstat (limited to 'include/linux/if_ether.h')
-rw-r--r--include/linux/if_ether.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index d62b4dfd8305..4037aaab7aa9 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -96,11 +96,19 @@
* This is an Ethernet frame header.
*/
-struct ethhdr
-{
+struct ethhdr {
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));
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+
+static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
+{
+ return (struct ethhdr *)skb->mac.raw;
+}
+#endif
+
#endif /* _LINUX_IF_ETHER_H */