binutils: fix build with host gcc < 4.9
[openwrt/openwrt.git] / package / network / utils / iptables / patches / 300-musl_fixes.patch
1 --- a/extensions/libip6t_ipv6header.c
2 +++ b/extensions/libip6t_ipv6header.c
3 @@ -10,6 +10,9 @@ on whether they contain certain headers
4 #include <netdb.h>
5 #include <xtables.h>
6 #include <linux/netfilter_ipv6/ip6t_ipv6header.h>
7 +#ifndef IPPROTO_HOPOPTS
8 +# define IPPROTO_HOPOPTS 0
9 +#endif
10
11 enum {
12 O_HEADER = 0,
13 --- a/extensions/libxt_TCPOPTSTRIP.c
14 +++ b/extensions/libxt_TCPOPTSTRIP.c
15 @@ -12,6 +12,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 O_STRIP_OPTION = 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_ipv4/ip_tables.h
64 +++ b/include/linux/netfilter_ipv4/ip_tables.h
65 @@ -16,6 +16,7 @@
66 #define _IPTABLES_H
67
68 #include <linux/types.h>
69 +#include <sys/types.h>
70
71 #include <linux/netfilter_ipv4.h>
72
73 --- a/iptables/ip6tables-restore.c
74 +++ b/iptables/ip6tables-restore.c
75 @@ -9,7 +9,7 @@
76 */
77
78 #include <getopt.h>
79 -#include <sys/errno.h>
80 +#include <errno.h>
81 #include <stdbool.h>
82 #include <string.h>
83 #include <stdio.h>
84 --- a/iptables/ip6tables-save.c
85 +++ b/iptables/ip6tables-save.c
86 @@ -6,7 +6,7 @@
87 * This code is distributed under the terms of GNU GPL v2
88 */
89 #include <getopt.h>
90 -#include <sys/errno.h>
91 +#include <errno.h>
92 #include <stdio.h>
93 #include <fcntl.h>
94 #include <stdlib.h>
95 --- a/iptables/iptables-restore.c
96 +++ b/iptables/iptables-restore.c
97 @@ -6,7 +6,7 @@
98 */
99
100 #include <getopt.h>
101 -#include <sys/errno.h>
102 +#include <errno.h>
103 #include <stdbool.h>
104 #include <string.h>
105 #include <stdio.h>
106 --- a/iptables/iptables-save.c
107 +++ b/iptables/iptables-save.c
108 @@ -6,7 +6,7 @@
109 *
110 */
111 #include <getopt.h>
112 -#include <sys/errno.h>
113 +#include <errno.h>
114 #include <stdio.h>
115 #include <fcntl.h>
116 #include <stdlib.h>
117 --- a/iptables/iptables-xml.c
118 +++ b/iptables/iptables-xml.c
119 @@ -7,7 +7,7 @@
120 */
121
122 #include <getopt.h>
123 -#include <sys/errno.h>
124 +#include <errno.h>
125 #include <string.h>
126 #include <stdio.h>
127 #include <stdlib.h>