1 From 75ba4a547282f91d653872a4bba5f5eae234ea6c Mon Sep 17 00:00:00 2001
2 From: rofl0r <retnyg@gmx.net>
3 Date: Wed, 22 Jan 2014 00:57:48 +0100
4 Subject: [PATCH 2/3] libc-compat.h: prevent redefinition of struct ethhdr
7 Signed-off-by: Khem Raj <raj.khem@gmail.com>
8 Upstream-Status: Submitted
10 include/uapi/linux/if_ether.h | 4 +++-
11 include/uapi/linux/libc-compat.h | 6 ++++++
12 2 files changed, 9 insertions(+), 1 deletion(-)
14 diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
15 index aa63ed0..e94da57 100644
16 --- a/include/uapi/linux/if_ether.h
17 +++ b/include/uapi/linux/if_ether.h
19 #define _UAPI_LINUX_IF_ETHER_H
21 #include <linux/types.h>
22 +#include <linux/libc-compat.h>
25 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
27 * This is an Ethernet frame header.
30 +#if __UAPI_DEF_ETHHDR
32 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
33 unsigned char h_source[ETH_ALEN]; /* source ether addr */
34 __be16 h_proto; /* packet type ID field */
35 } __attribute__((packed));
39 #endif /* _UAPI_LINUX_IF_ETHER_H */
40 diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
41 index afe15c2..7d0c78a 100644
42 --- a/include/uapi/linux/libc-compat.h
43 +++ b/include/uapi/linux/libc-compat.h
46 #ifndef __KERNEL__ /* we're used from userspace */
48 +#ifdef _NETINET_IF_ETHER_H /* musl */
49 +#define __UAPI_DEF_ETHHDR 0
50 +#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */
51 +#define __UAPI_DEF_ETHHDR 1
54 /* Coordinate with libc netinet/in.h header. */
55 #if defined(_NETINET_IN_H)