summaryrefslogtreecommitdiff
path: root/include/linux/if_ether.h
diff options
context:
space:
mode:
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 */