sngrep: fix error if gnutls and openssl are both enabled
[buildroot-gz.git] / package / arptables / 0004-Fix-musl-build-issue.patch
blobe9419b0a9643c15fb2df786e58b122d2c011c079
1 From cbf84a0bc377c6a368d30571f37ebfab27784697 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
3 Date: Wed, 2 Dec 2015 04:57:33 +0100
4 Subject: [PATCH 4/4] Fix musl build issue
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Due to clashes in the namespace between the Linux Kernel headers and the
10 netinet headers building arptables with the musl C library fails.
12 Best advice from the musl developers is to not include both headers in a
13 userspace tool (see the thread on the musl mailing list [1], especially [2]).
15 Since arptables only requires a few definitions from the Linux Kernel headers
16 we opt-out the clashing header files and define the needed definitions.
18 [1] http://www.openwall.com/lists/musl/2012/10/09/1
19 [2] http://www.openwall.com/lists/musl/2012/10/11/1
21 Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
22 ---
23 extensions/arpt_CLASSIFY.c | 7 +++++++
24 include/linux/netfilter_arp.h | 11 +++++++++++
25 2 files changed, 18 insertions(+)
27 diff --git a/extensions/arpt_CLASSIFY.c b/extensions/arpt_CLASSIFY.c
28 index cb5770b..c58129f 100644
29 --- a/extensions/arpt_CLASSIFY.c
30 +++ b/extensions/arpt_CLASSIFY.c
31 @@ -21,7 +21,14 @@
32 #include <stdio.h>
33 #include <getopt.h>
34 #include <arptables.h>
36 +#ifdef __KERNEL__
37 #include <linux/netfilter/xt_CLASSIFY.h>
38 +#else
39 +struct xt_classify_target_info {
40 + uint32_t priority;
41 +};
42 +#endif
44 #define TC_H_MAJ_MASK (0xFFFF0000U)
45 #define TC_H_MIN_MASK (0x0000FFFFU)
46 diff --git a/include/linux/netfilter_arp.h b/include/linux/netfilter_arp.h
47 index 92bc6dd..2a63e82 100644
48 --- a/include/linux/netfilter_arp.h
49 +++ b/include/linux/netfilter_arp.h
50 @@ -5,7 +5,18 @@
51 * (C)2002 Rusty Russell IBM -- This code is GPL.
54 +#ifdef __KERNEL__
55 #include <linux/netfilter.h>
56 +#else
57 +/* Responses from hook functions. */
58 +#define NF_DROP 0
59 +#define NF_ACCEPT 1
60 +#define NF_STOLEN 2
61 +#define NF_QUEUE 3
62 +#define NF_REPEAT 4
63 +#define NF_STOP 5
64 +#define NF_MAX_VERDICT NF_STOP
65 +#endif
67 /* There is no PF_ARP. */
68 #define NF_ARP 0
69 --
70 2.6.2