[package] iptables: add some musl portability fixes
[openwrt/svn-archive/archive.git] / package / network / utils / iptables / patches / 300-musl_fixes.patch
1 --- a/extensions/libip6t_ipv6header.c
2 +++ b/extensions/libip6t_ipv6header.c
3 @@ -15,6 +15,9 @@ on whether they contain certain headers
4 #include <sys/types.h>
5
6 #include <linux/netfilter_ipv6/ip6t_ipv6header.h>
7 +#ifndef IPPROTO_HOPOPTS
8 +# define IPPROTO_HOPOPTS 0
9 +#endif
10
11 /* This maybe required
12 #include <linux/in.h>
13 --- a/extensions/libxt_TCPOPTSTRIP.c
14 +++ b/extensions/libxt_TCPOPTSTRIP.c
15 @@ -16,6 +16,21 @@
16 #ifndef TCPOPT_MD5SIG
17 # define TCPOPT_MD5SIG 19
18 #endif
19 +#ifndef TCPOPT_MAXSEG
20 +# define TCPOPT_MAXSEG 2
21 +#endif
22 +#ifndef TCPOPT_WINDOW
23 +# define TCPOPT_WINDOW 3
24 +#endif
25 +#ifndef TCPOPT_SACK_PERMITTED
26 +# define TCPOPT_SACK_PERMITTED 4
27 +#endif
28 +#ifndef TCPOPT_SACK
29 +# define TCPOPT_SACK 5
30 +#endif
31 +#ifndef TCPOPT_TIMESTAMP
32 +# define TCPOPT_TIMESTAMP 8
33 +#endif
34
35 enum {
36 FLAG_STRIP = 1 << 0,
37 --- a/include/libiptc/ipt_kernel_headers.h
38 +++ b/include/libiptc/ipt_kernel_headers.h
39 @@ -5,7 +5,6 @@
40
41 #include <limits.h>
42
43 -#if defined(__GLIBC__) && __GLIBC__ == 2
44 #include <netinet/ip.h>
45 #include <netinet/in.h>
46 #include <netinet/ip_icmp.h>
47 @@ -13,15 +12,4 @@
48 #include <netinet/udp.h>
49 #include <net/if.h>
50 #include <sys/types.h>
51 -#else /* libc5 */
52 -#include <sys/socket.h>
53 -#include <linux/ip.h>
54 -#include <linux/in.h>
55 -#include <linux/if.h>
56 -#include <linux/icmp.h>
57 -#include <linux/tcp.h>
58 -#include <linux/udp.h>
59 -#include <linux/types.h>
60 -#include <linux/in6.h>
61 -#endif
62 #endif
63 --- a/include/linux/netfilter/xt_osf.h
64 +++ b/include/linux/netfilter/xt_osf.h
65 @@ -21,6 +21,9 @@
66 #define _XT_OSF_H
67
68 #include <linux/types.h>
69 +#if !defined(__UCLIBC__) && !defined(__GLIBC_)
70 +#include <linux/tcp.h>
71 +#endif
72
73 #define MAXGENRELEN 32
74
75 --- a/include/linux/netfilter_ipv4/ip_tables.h
76 +++ b/include/linux/netfilter_ipv4/ip_tables.h
77 @@ -16,6 +16,7 @@
78 #define _IPTABLES_H
79
80 #include <linux/types.h>
81 +#include <sys/types.h>
82
83 #include <linux/netfilter_ipv4.h>
84
85 --- a/ip6tables-restore.c
86 +++ b/ip6tables-restore.c
87 @@ -11,7 +11,7 @@
88 */
89
90 #include <getopt.h>
91 -#include <sys/errno.h>
92 +#include <errno.h>
93 #include <stdbool.h>
94 #include <string.h>
95 #include <stdio.h>
96 --- a/ip6tables-save.c
97 +++ b/ip6tables-save.c
98 @@ -6,7 +6,7 @@
99 * This code is distributed under the terms of GNU GPL v2
100 */
101 #include <getopt.h>
102 -#include <sys/errno.h>
103 +#include <errno.h>
104 #include <stdio.h>
105 #include <fcntl.h>
106 #include <stdlib.h>
107 --- a/iptables-restore.c
108 +++ b/iptables-restore.c
109 @@ -8,7 +8,7 @@
110 */
111
112 #include <getopt.h>
113 -#include <sys/errno.h>
114 +#include <errno.h>
115 #include <stdbool.h>
116 #include <string.h>
117 #include <stdio.h>
118 --- a/iptables-save.c
119 +++ b/iptables-save.c
120 @@ -6,7 +6,7 @@
121 *
122 */
123 #include <getopt.h>
124 -#include <sys/errno.h>
125 +#include <errno.h>
126 #include <stdio.h>
127 #include <fcntl.h>
128 #include <stdlib.h>
129 --- a/iptables-xml.c
130 +++ b/iptables-xml.c
131 @@ -9,7 +9,7 @@
132 */
133
134 #include <getopt.h>
135 -#include <sys/errno.h>
136 +#include <errno.h>
137 #include <string.h>
138 #include <stdio.h>
139 #include <stdlib.h>