Skip to content
Permalink
Browse files

libc-compat.h: prevent redefinition of struct ethhdr

  • Loading branch information...
rofl0r committed Jan 21, 2014
1 parent 3cd5b95 commit 4ffbb51f2abfbefa73cbd418f55b20148d04959a
Showing with 9 additions and 1 deletion.
  1. +3 −1 generic/include/linux/if_ether.h
  2. +6 −0 generic/include/linux/libc-compat.h
@@ -22,6 +22,7 @@
#define _LINUX_IF_ETHER_H

#include <linux/types.h>
#include <linux/libc-compat.h>

/*
* IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
@@ -130,11 +131,12 @@
* This is an Ethernet frame header.
*/

#if __UAPI_DEF_ETHHDR
struct ethhdr {
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
__be16 h_proto; /* packet type ID field */
} __attribute__((packed));

#endif

#endif /* _LINUX_IF_ETHER_H */
@@ -50,6 +50,12 @@

#ifndef __KERNEL__ /* we're used from userspace */

#ifdef _NETINET_IF_ETHER_H /* musl */
#define __UAPI_DEF_ETHHDR 0
#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */
#define __UAPI_DEF_ETHHDR 1
#endif

/* Coordinate with libc netinet/in.h header. */
#if defined(_NETINET_IN_H)

0 comments on commit 4ffbb51

Please sign in to comment.
You can’t perform that action at this time.