Updated iputils PKGBUILD + added new patch
[Archlinux-Stable.git] / base / iputils / iputils-ss021109-try.patch
blob4d9a70597c20b0d130723b587321de8349036a7a
1 diff -urN iputils.orig/Makefile iputils/Makefile
2 --- iputils.orig/Makefile 2004-05-02 20:30:43.000000000 +0000
3 +++ iputils/Makefile 2004-05-02 20:30:48.000000000 +0000
4 @@ -1,5 +1,4 @@
5 # Path to parent kernel include files directory
6 -KERNEL_INCLUDE=/usr/src/linux/include
7 LIBC_INCLUDE=/usr/include
9 DEFINES=
10 @@ -8,21 +7,6 @@
11 LDLIBS=-lresolv
12 ADDLIB=
14 -ifeq ($(LIBC_INCLUDE)/socketbits.h,$(wildcard $(LIBC_INCLUDE)/socketbits.h))
15 - ifeq ($(LIBC_INCLUDE)/net/if_packet.h,$(wildcard $(LIBC_INCLUDE)/net/if_packet.h))
16 - GLIBCFIX=-Iinclude-glibc -include include-glibc/glibc-bugs.h
17 - endif
18 -endif
19 -ifeq ($(LIBC_INCLUDE)/bits/socket.h,$(wildcard $(LIBC_INCLUDE)/bits/socket.h))
20 - GLIBCFIX=-Iinclude-glibc -include include-glibc/glibc-bugs.h
21 -endif
23 -ifeq ($(KERNEL_INCLUDE)/linux/pfkeyv2.h,$(wildcard $(KERNEL_INCLUDE)/linux/pfkeyv2.h))
24 - SUBDIRS=libipsec setkey
25 - LDLIBS+=-Llibipsec -lipsec
26 - IPSECDEF=-DDO_IPSEC -Ilibipsec
27 -endif
30 #options if you compile with libc5, and without a bind>=4.9.4 libresolv
31 # NOT AVAILABLE. Please, use libresolv.
32 @@ -31,13 +15,13 @@
33 # What a pity, all new gccs are buggy and -Werror does not work. Sigh.
34 #CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g -Werror
35 CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g
36 -CFLAGS=$(CCOPT) $(GLIBCFIX) -I$(KERNEL_INCLUDE) -I../include $(IPSECDEF) $(DEFINES)
37 +CFLAGS=$(CCOPT) -I../include $(IPSECDEF) $(DEFINES)
39 IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
40 IPV6_TARGETS=tracepath6 traceroute6 ping6
41 TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
43 -all: check-kernel subdirs $(TARGETS)
44 +all: subdirs $(TARGETS)
47 tftpd: tftpd.o tftpsubs.o
48 @@ -51,15 +35,6 @@
49 rdisc_srv.o: rdisc.c
50 $(CC) $(CFLAGS) -DRDISC_SERVER -o rdisc_srv.o rdisc.c
52 -check-kernel:
53 -ifeq ($(KERNEL_INCLUDE),)
54 - @echo "Please, set correct KERNEL_INCLUDE"; false
55 -else
56 - @set -e; \
57 - if [ ! -r $(KERNEL_INCLUDE)/linux/autoconf.h ]; then \
58 - echo "Please, set correct KERNEL_INCLUDE"; false; fi
59 -endif
61 subdirs:
62 ifneq ($(SUBDIRS),)
63 @set -e; \
64 diff -urN iputils.orig/arping.c iputils/arping.c
65 --- iputils.orig/arping.c 2004-05-02 20:30:43.000000000 +0000
66 +++ iputils/arping.c 2004-05-02 20:32:38.000000000 +0000
67 @@ -9,6 +9,7 @@
68 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
71 +#include <asm/byteorder.h>
72 #include <stdlib.h>
73 #include <sys/param.h>
74 #include <sys/socket.h>
75 @@ -19,6 +20,8 @@
76 #include <sys/ioctl.h>
77 #include <linux/if.h>
78 #include <linux/if_arp.h>
79 +#include <linux/if_ether.h>
80 +#include <linux/if_packet.h>
81 #include <sys/uio.h>
83 #include <netdb.h>
84 diff -urN iputils.orig/clockdiff.c iputils/clockdiff.c
85 --- iputils.orig/clockdiff.c 2004-05-02 20:30:43.000000000 +0000
86 +++ iputils/clockdiff.c 2004-05-02 20:30:48.000000000 +0000
87 @@ -1,3 +1,4 @@
88 +#include <asm/byteorder.h>
89 #include <time.h>
90 #include <sys/types.h>
91 #include <sys/param.h>
92 diff -urN iputils.orig/ping.c iputils/ping.c
93 --- iputils.orig/ping.c 2004-05-02 20:30:43.000000000 +0000
94 +++ iputils/ping.c 2004-05-02 20:31:03.000000000 +0000
95 @@ -61,7 +61,7 @@
96 #include "ping_common.h"
98 #include <netinet/ip.h>
99 -#include <netinet/ip_icmp.h>
100 +#include <linux/icmp.h>
101 #ifdef DO_IPSEC
102 #include <libipsec.h>
103 #endif
104 diff -urN iputils.orig/ping_common.h iputils/ping_common.h
105 --- iputils.orig/ping_common.h 2004-05-02 20:30:43.000000000 +0000
106 +++ iputils/ping_common.h 2004-05-02 20:30:48.000000000 +0000
107 @@ -1,3 +1,4 @@
108 +#include <asm/byteorder.h>
109 #include <stdio.h>
110 #include <stdlib.h>
111 #include <unistd.h>
112 diff -urN iputils.orig/rarpd.c iputils/rarpd.c
113 --- iputils.orig/rarpd.c 2004-05-02 20:30:43.000000000 +0000
114 +++ iputils/rarpd.c 2004-05-02 20:33:07.000000000 +0000
115 @@ -9,6 +9,7 @@
116 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
119 +#include <asm/byteorder.h>
120 #include <stdio.h>
121 #include <syslog.h>
122 #include <dirent.h>
123 @@ -26,6 +27,7 @@
124 #include <sys/signal.h>
125 #include <linux/if.h>
126 #include <linux/if_arp.h>
127 +#include <linux/if_ether.h>
128 #include <netinet/in.h>
129 #include <linux/if_packet.h>
130 #include <linux/filter.h>
131 @@ -52,12 +54,12 @@
132 int hatype;
133 unsigned char lladdr[16];
134 unsigned char name[IFNAMSIZ];
135 - struct ifaddr *ifa_list;
136 + struct l_ifaddr *ifa_list;
137 } *ifl_list;
139 -struct ifaddr
140 +struct l_ifaddr
142 - struct ifaddr *next;
143 + struct l_ifaddr *next;
144 __u32 prefix;
145 __u32 mask;
146 __u32 local;
147 @@ -89,7 +91,7 @@
148 int fd;
149 struct ifreq *ifrp, *ifend;
150 struct iflink *ifl;
151 - struct ifaddr *ifa;
152 + struct l_ifaddr *ifa;
153 struct ifconf ifc;
154 struct ifreq ibuf[256];
156 @@ -180,7 +182,7 @@
157 if (ifa == NULL) {
158 if (mask == 0 || prefix == 0)
159 continue;
160 - ifa = (struct ifaddr*)malloc(sizeof(*ifa));
161 + ifa = (struct l_ifaddr*)malloc(sizeof(*ifa));
162 memset(ifa, 0, sizeof(*ifa));
163 ifa->local = addr;
164 ifa->prefix = prefix;
165 @@ -236,10 +238,10 @@
166 return dent != NULL;
169 -struct ifaddr *select_ipaddr(int ifindex, __u32 *sel_addr, __u32 **alist)
170 +struct l_ifaddr *select_ipaddr(int ifindex, __u32 *sel_addr, __u32 **alist)
172 struct iflink *ifl;
173 - struct ifaddr *ifa;
174 + struct l_ifaddr *ifa;
175 int retry = 0;
176 int i;
178 @@ -295,7 +297,7 @@
180 if (r == NULL) {
181 if (hatype == ARPHRD_ETHER && halen == 6) {
182 - struct ifaddr *ifa;
183 + struct l_ifaddr *ifa;
184 struct hostent *hp;
185 char ename[256];
186 static struct rarp_map emap = {
187 @@ -364,7 +366,7 @@
189 __u32 laddr = 0;
190 struct iflink *ifl;
191 - struct ifaddr *ifa;
192 + struct l_ifaddr *ifa;
194 for (ifl=ifl_list; ifl; ifl = ifl->next)
195 if (ifl->index == ifindex)
196 diff -urN iputils.orig/rdisc.c iputils/rdisc.c
197 --- iputils.orig/rdisc.c 2004-05-02 20:30:43.000000000 +0000
198 +++ iputils/rdisc.c 2004-05-02 20:30:48.000000000 +0000
199 @@ -25,6 +25,7 @@
200 * 2550 Garcia Avenue
201 * Mountain View, California 94043
203 +#include <asm/byteorder.h>
204 #include <stdio.h>
205 #include <errno.h>
206 #include <signal.h>
207 diff -urN iputils.orig/tftpd.c iputils/tftpd.c
208 --- iputils.orig/tftpd.c 2004-05-02 20:30:43.000000000 +0000
209 +++ iputils/tftpd.c 2004-05-02 20:30:48.000000000 +0000
210 @@ -48,6 +48,7 @@
211 * This version includes many modifications by Jim Guyton <guyton@rand-unix>
214 +#include <asm/byteorder.h>
215 #include <sys/types.h>
216 #include <sys/ioctl.h>
217 #include <sys/stat.h>
218 diff -urN iputils.orig/tracepath.c iputils/tracepath.c
219 --- iputils.orig/tracepath.c 2004-05-02 20:30:43.000000000 +0000
220 +++ iputils/tracepath.c 2004-05-02 20:30:48.000000000 +0000
221 @@ -9,6 +9,7 @@
222 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
225 +#include <asm/byteorder.h>
226 #include <stdio.h>
227 #include <stdlib.h>
228 #include <unistd.h>
229 diff -urN iputils.orig/traceroute6.c iputils/traceroute6.c
230 --- iputils.orig/traceroute6.c 2004-05-02 20:30:43.000000000 +0000
231 +++ iputils/traceroute6.c 2004-05-02 20:30:48.000000000 +0000
232 @@ -230,6 +230,7 @@
233 * Tue Dec 20 03:50:13 PST 1988
236 +#include <asm/byteorder.h>
237 #include <sys/param.h>
238 #include <sys/time.h>
239 #include <sys/socket.h>