1 Submitted By: Jim Gifford (jim at cross-lfs dot org)
3 Initial Package Version: s20071127
4 Origin: Debian and Fedora
5 Upstream Status: Unknown
6 Description: Fixes Various Issues
8 diff -Naur iputils-s20071127.orig/arping.c iputils-s20071127/arping.c
9 --- iputils-s20071127.orig/arping.c 2007-11-26 16:57:27.000000000 -0800
10 +++ iputils-s20071127/arping.c 2009-02-18 23:18:09.239954184 -0800
15 - if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500))
17 + if (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500)
20 - if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
21 + if ((!timeout) && (count == 0))
24 + if ( count!=0 && (last.tv_sec==0 || MS_TDIFF(tv,last) > 500 ) ) {
25 send_pack(s, src, dst, &me, &he);
26 - if (count == 0 && unsolicited)
29 + if (count==0 && unsolicited)
33 diff -Naur iputils-s20071127.orig/doc/docbook2man-spec.pl iputils-s20071127/doc/docbook2man-spec.pl
34 --- iputils-s20071127.orig/doc/docbook2man-spec.pl 2007-11-26 16:57:27.000000000 -0800
35 +++ iputils-s20071127/doc/docbook2man-spec.pl 2009-02-18 23:18:09.239954184 -0800
39 if($_[0]->attribute('CHOICE')->value =~ /opt/i) {
48 if($_[0]->attribute('CHOICE')->value =~ /opt/i) {
54 diff -Naur iputils-s20071127.orig/doc/Makefile iputils-s20071127/doc/Makefile
55 --- iputils-s20071127.orig/doc/Makefile 2007-11-26 16:57:27.000000000 -0800
56 +++ iputils-s20071127/doc/Makefile 2009-02-18 23:18:09.239954184 -0800
59 html: $(HTMLFILES) iputils.html
62 +man: $(MANFILES) fix_sgml2man
64 # docbook scripts are incredibly dirty in the sense that they leak
65 # lots of some strange temporary junk directories and files.
67 @set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
71 + @sed -i -e 's!\\fB\\fIdestination\\fB\\fR \[\\fB/\\fIport\\fB\\fR\]!\\fB\\fIdestination\\fB\\fR[\\fB/\\fIport\\fB\\fR]!g' tracepath.8
74 @rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html tmp.db2man
76 diff -Naur iputils-s20071127.orig/Makefile iputils-s20071127/Makefile
77 --- iputils-s20071127.orig/Makefile 2007-11-26 16:57:27.000000000 -0800
78 +++ iputils-s20071127/Makefile 2009-02-18 23:18:09.239954184 -0800
80 CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g
81 CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES)
83 -IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
84 +IPV4_TARGETS=tracepath ping clockdiff rdisc arping
85 IPV6_TARGETS=tracepath6 traceroute6 ping6
86 TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
93 tftpd: tftpd.o tftpsubs.o
94 ping: ping.o ping_common.o
95 ping6: ping6.o ping_common.o
98 $(CC) $(CFLAGS) -DRDISC_SERVER -o rdisc_srv.o rdisc.c
102 ifeq ($(KERNEL_INCLUDE),)
103 @echo "Please, set correct KERNEL_INCLUDE"; false
104 diff -Naur iputils-s20071127.orig/ping6.c iputils-s20071127/ping6.c
105 --- iputils-s20071127.orig/ping6.c 2007-11-26 16:57:27.000000000 -0800
106 +++ iputils-s20071127/ping6.c 2009-02-18 23:18:09.239954184 -0800
108 fprintf(stderr, "ping: unknown iface %s\n", device);
111 - cmsg = (struct cmsghdr*)cmsgbuf;
112 + cmsg = (struct cmsghdr*)(cmsgbuf+cmsglen);
113 cmsglen += CMSG_SPACE(sizeof(*ipi));
114 cmsg->cmsg_len = CMSG_LEN(sizeof(*ipi));
115 cmsg->cmsg_level = SOL_IPV6;
118 * select icmp echo reply as icmp type to receive
121 ICMP6_FILTER_SETBLOCKALL(&filter);
123 if (!working_recverr) {
124 diff -Naur iputils-s20071127.orig/ping.c iputils-s20071127/ping.c
125 --- iputils-s20071127.orig/ping.c 2007-11-26 16:57:27.000000000 -0800
126 +++ iputils-s20071127/ping.c 2009-02-18 23:18:09.239954184 -0800
129 options |= F_NUMERIC;
131 - hp = gethostbyname(target);
132 + hp = gethostbyname2(target, AF_INET);
134 fprintf(stderr, "ping: unknown host %s\n", target);
138 printf("Source Route Failed\n");
140 + case ICMP_NET_UNKNOWN:
141 + printf("Destination Net Unknown\n");
143 + case ICMP_HOST_UNKNOWN:
144 + printf("Destination Host Unknown\n");
146 + case ICMP_HOST_ISOLATED:
147 + printf("Source Host Isolated\n");
150 + printf("Destination Net Prohibited\n");
152 + case ICMP_HOST_ANO:
153 + printf("Destination Host Prohibited\n");
155 + case ICMP_NET_UNR_TOS:
156 + printf("Destination Net Unreachable for Type of Service\n");
158 + case ICMP_HOST_UNR_TOS:
159 + printf("Destination Host Unreachable for Type of Service\n");
161 case ICMP_PKT_FILTERED:
162 printf("Packet filtered\n");
164 + case ICMP_PREC_VIOLATION:
165 + printf("Precedence Violation\n");
167 + case ICMP_PREC_CUTOFF:
168 + printf("Precedence Cutoff\n");
171 printf("Dest Unreachable, Bad Code: %d\n", code);
173 diff -Naur iputils-s20071127.orig/ping_common.c iputils-s20071127/ping_common.c
174 --- iputils-s20071127.orig/ping_common.c 2007-11-26 16:57:27.000000000 -0800
175 +++ iputils-s20071127/ping_common.c 2009-02-18 23:18:09.239954184 -0800
179 printf(", pipe %d", pipesize);
180 - if (ntransmitted > 1 && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
181 + if (ntransmitted > 1 && nreceived &&
182 + (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
183 int ipg = (1000000*(long long)tv.tv_sec+tv.tv_usec)/(ntransmitted-1);
184 printf(", ipg/ewma %d.%03d/%d.%03d ms",
185 ipg/1000, ipg%1000, rtt/8000, (rtt/8)%1000);
188 fprintf(stderr, "\n");
191 diff -Naur iputils-s20071127.orig/rdisc.c iputils-s20071127/rdisc.c
192 --- iputils-s20071127.orig/rdisc.c 2007-11-26 16:57:27.000000000 -0800
193 +++ iputils-s20071127/rdisc.c 2009-02-18 23:18:31.745396284 -0800
194 @@ -240,14 +240,25 @@
202 + if ((open_max = sysconf(_SC_OPEN_MAX)) == -1) {
204 + (void) fprintf(stderr, "OPEN_MAX is not supported\n");
207 + (void) fprintf(stderr, "sysconf() error\n");
213 if ((pid=fork()) != 0)
216 - for (t = 0; t < OPEN_MAX; t++)
217 + for (t = 0; t < open_max; t++)
221 diff -Naur iputils-s20071127.orig/tracepath.c iputils-s20071127/tracepath.c
222 --- iputils-s20071127.orig/tracepath.c 2007-11-26 16:57:27.000000000 -0800
223 +++ iputils-s20071127/tracepath.c 2009-02-18 23:18:09.239954184 -0800
225 base_port = atoi(p+1);
228 - he = gethostbyname(argv[0]);
229 + he = gethostbyname2(argv[0], AF_INET);
231 - herror("gethostbyname");
232 + herror("gethostbyname2");
235 memcpy(&target.sin_addr, he->h_addr, 4);