source: patches/iputils-s20071127-fixes-1.patch@ e6c6e3e

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since e6c6e3e was 7d38869, checked in by Jim Gifford <clfs@…>, 16 years ago

Replaced Inetutils with IPutils

  • Property mode set to 100644
File size: 6.3 KB
RevLine 
[7d38869]1Submitted By: Jim Gifford (jim at cross-lfs dot org)
2Date: 01-15-2009
3Initial Package Version: s20071127
4Origin: Debian
5Upstream Status: Unknown
6Description: Fixes Various Issues
7
8diff -Naur iputils-s20071127.orig/Makefile iputils-s20071127/Makefile
9--- iputils-s20071127.orig/Makefile 2007-11-26 16:57:27.000000000 -0800
10+++ iputils-s20071127/Makefile 2009-01-15 22:02:32.000000000 -0800
11@@ -16,7 +16,7 @@
12 CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g
13 CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES)
14
15-IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
16+IPV4_TARGETS=tracepath ping arping
17 IPV6_TARGETS=tracepath6 traceroute6 ping6
18 TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
19
20@@ -25,7 +25,6 @@
21
22 all: $(TARGETS)
23
24-
25 tftpd: tftpd.o tftpsubs.o
26 ping: ping.o ping_common.o
27 ping6: ping6.o ping_common.o
28@@ -37,7 +36,6 @@
29 rdisc_srv.o: rdisc.c
30 $(CC) $(CFLAGS) -DRDISC_SERVER -o rdisc_srv.o rdisc.c
31
32-
33 check-kernel:
34 ifeq ($(KERNEL_INCLUDE),)
35 @echo "Please, set correct KERNEL_INCLUDE"; false
36diff -Naur iputils-s20071127.orig/arping.c iputils-s20071127/arping.c
37--- iputils-s20071127.orig/arping.c 2007-11-26 16:57:27.000000000 -0800
38+++ iputils-s20071127/arping.c 2009-01-15 22:02:51.000000000 -0800
39@@ -168,12 +168,17 @@
40 if (start.tv_sec==0)
41 start = tv;
42
43- if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500))
44- finish();
45+ if (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500)
46+ finish();
47
48- if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
49+ if ((!timeout) && (count == 0))
50+ finish();
51+
52+ if ( count!=0 && (last.tv_sec==0 || MS_TDIFF(tv,last) > 500 ) ) {
53 send_pack(s, src, dst, &me, &he);
54- if (count == 0 && unsolicited)
55+ if (count >= 0)
56+ count--;
57+ if (count==0 && unsolicited)
58 finish();
59 }
60 alarm(1);
61diff -Naur iputils-s20071127.orig/doc/Makefile iputils-s20071127/doc/Makefile
62--- iputils-s20071127.orig/doc/Makefile 2007-11-26 16:57:27.000000000 -0800
63+++ iputils-s20071127/doc/Makefile 2009-01-15 22:02:41.000000000 -0800
64@@ -6,7 +6,7 @@
65
66 html: $(HTMLFILES) iputils.html
67
68-man: $(MANFILES)
69+man: $(MANFILES) fix_sgml2man
70
71 # docbook scripts are incredibly dirty in the sense that they leak
72 # lots of some strange temporary junk directories and files.
73@@ -33,6 +33,9 @@
74 @set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
75 @-rm -rf tmp.db2man
76
77+fix_sgml2man:
78+ @sed -i -e 's!\\fB\\fIdestination\\fB\\fR \[\\fB/\\fIport\\fB\\fR\]!\\fB\\fIdestination\\fB\\fR[\\fB/\\fIport\\fB\\fR]!g' tracepath.8
79+
80 clean:
81 @rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html tmp.db2man
82
83diff -Naur iputils-s20071127.orig/doc/docbook2man-spec.pl iputils-s20071127/doc/docbook2man-spec.pl
84--- iputils-s20071127.orig/doc/docbook2man-spec.pl 2007-11-26 16:57:27.000000000 -0800
85+++ iputils-s20071127/doc/docbook2man-spec.pl 2009-01-15 22:02:19.000000000 -0800
86@@ -428,7 +428,7 @@
87 output ' ';
88
89 if($_[0]->attribute('CHOICE')->value =~ /opt/i) {
90- output '[ ';
91+ output '[';
92 }
93 bold_on();
94 }
95@@ -441,7 +441,7 @@
96 font_off();
97 }
98 if($_[0]->attribute('CHOICE')->value =~ /opt/i) {
99- output '] ';
100+ output ']';
101 }
102 }
103
104diff -Naur iputils-s20071127.orig/ping.c iputils-s20071127/ping.c
105--- iputils-s20071127.orig/ping.c 2007-11-26 16:57:27.000000000 -0800
106+++ iputils-s20071127/ping.c 2009-01-15 22:01:59.000000000 -0800
107@@ -249,7 +249,7 @@
108 if (argc == 1)
109 options |= F_NUMERIC;
110 } else {
111- hp = gethostbyname(target);
112+ hp = gethostbyname2(target, AF_INET);
113 if (!hp) {
114 fprintf(stderr, "ping: unknown host %s\n", target);
115 exit(2);
116@@ -865,9 +865,36 @@
117 case ICMP_SR_FAILED:
118 printf("Source Route Failed\n");
119 break;
120+ case ICMP_NET_UNKNOWN:
121+ printf("Destination Net Unknown\n");
122+ break;
123+ case ICMP_HOST_UNKNOWN:
124+ printf("Destination Host Unknown\n");
125+ break;
126+ case ICMP_HOST_ISOLATED:
127+ printf("Source Host Isolated\n");
128+ break;
129+ case ICMP_NET_ANO:
130+ printf("Destination Net Prohibited\n");
131+ break;
132+ case ICMP_HOST_ANO:
133+ printf("Destination Host Prohibited\n");
134+ break;
135+ case ICMP_NET_UNR_TOS:
136+ printf("Destination Net Unreachable for Type of Service\n");
137+ break;
138+ case ICMP_HOST_UNR_TOS:
139+ printf("Destination Host Unreachable for Type of Service\n");
140+ break;
141 case ICMP_PKT_FILTERED:
142 printf("Packet filtered\n");
143 break;
144+ case ICMP_PREC_VIOLATION:
145+ printf("Precedence Violation\n");
146+ break;
147+ case ICMP_PREC_CUTOFF:
148+ printf("Precedence Cutoff\n");
149+ break;
150 default:
151 printf("Dest Unreachable, Bad Code: %d\n", code);
152 break;
153diff -Naur iputils-s20071127.orig/ping6.c iputils-s20071127/ping6.c
154--- iputils-s20071127.orig/ping6.c 2007-11-26 16:57:27.000000000 -0800
155+++ iputils-s20071127/ping6.c 2009-01-15 22:02:11.000000000 -0800
156@@ -414,7 +414,7 @@
157 fprintf(stderr, "ping: unknown iface %s\n", device);
158 exit(2);
159 }
160- cmsg = (struct cmsghdr*)cmsgbuf;
161+ cmsg = (struct cmsghdr*)(cmsgbuf+cmsglen);
162 cmsglen += CMSG_SPACE(sizeof(*ipi));
163 cmsg->cmsg_len = CMSG_LEN(sizeof(*ipi));
164 cmsg->cmsg_level = SOL_IPV6;
165@@ -486,7 +486,6 @@
166 /*
167 * select icmp echo reply as icmp type to receive
168 */
169-
170 ICMP6_FILTER_SETBLOCKALL(&filter);
171
172 if (!working_recverr) {
173diff -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-01-15 22:01:42.000000000 -0800
176@@ -818,7 +818,8 @@
177 }
178 if (pipesize > 1)
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);
186@@ -852,4 +853,3 @@
187 }
188 fprintf(stderr, "\n");
189 }
190-
191diff -Naur iputils-s20071127.orig/tracepath.c iputils-s20071127/tracepath.c
192--- iputils-s20071127.orig/tracepath.c 2007-11-26 16:57:27.000000000 -0800
193+++ iputils-s20071127/tracepath.c 2009-01-15 22:01:59.000000000 -0800
194@@ -318,9 +318,9 @@
195 base_port = atoi(p+1);
196 } else
197 base_port = 44444;
198- he = gethostbyname(argv[0]);
199+ he = gethostbyname2(argv[0], AF_INET);
200 if (he == NULL) {
201- herror("gethostbyname");
202+ herror("gethostbyname2");
203 exit(1);
204 }
205 memcpy(&target.sin_addr, he->h_addr, 4);
206
207
Note: See TracBrowser for help on using the repository browser.