aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-04-08 07:53:56 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2016-04-08 07:53:56 +0000
commitac6cba75d35e4cc13bab2b025dbd07a93077227b (patch)
tree8b6c1cb1d0ea26a8e50e180644aca5da60de3baf /main/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
parent76f490d687a8bdc95146adf0a40deb5d5f640ee6 (diff)
downloadaports-ac6cba75d35e4cc13bab2b025dbd07a93077227b.tar.bz2
aports-ac6cba75d35e4cc13bab2b025dbd07a93077227b.tar.xz
main/linux-headers: bring back the patches for musl
Diffstat (limited to 'main/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch')
-rw-r--r--main/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/main/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch b/main/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
new file mode 100644
index 0000000000..c617093749
--- /dev/null
+++ b/main/linux-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
@@ -0,0 +1,59 @@
+From 75ba4a547282f91d653872a4bba5f5eae234ea6c Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Wed, 22 Jan 2014 00:57:48 +0100
+Subject: [PATCH 2/3] libc-compat.h: prevent redefinition of struct ethhdr
+
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted
+
+ include/uapi/linux/if_ether.h | 4 +++-
+ include/uapi/linux/libc-compat.h | 6 ++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
+index aa63ed0..e94da57 100644
+--- a/include/uapi/linux/if_ether.h
++++ b/include/uapi/linux/if_ether.h
+@@ -22,6 +22,7 @@
+ #define _UAPI_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
+@@ -134,11 +135,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 /* _UAPI_LINUX_IF_ETHER_H */
+diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
+index afe15c2..7d0c78a 100644
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.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)
+
+--
+2.6.4
+