source: patches/iputils-s20100418-fixes-1.patch@ 1dfba52

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 1dfba52 was 8867e46, checked in by Joe Ciccone <jciccone@…>, 14 years ago

Updated IPUtils to s20100418.

  • Property mode set to 100644
File size: 5.4 KB
RevLine 
[8867e46]1diff -Naur iputils-s20100418.orig/Makefile iputils-s20100418/Makefile
2--- iputils-s20100418.orig/Makefile 2010-04-18 00:45:45.000000000 -0400
3+++ iputils-s20100418/Makefile 2010-08-04 19:52:08.438080809 -0400
4@@ -16,7 +16,7 @@
5 CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g
6 CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES)
7
8-IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
9+IPV4_TARGETS=tracepath ping arping clockdiff
10 IPV6_TARGETS=tracepath6 traceroute6 ping6
11 TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
12
13diff -Naur iputils-s20100418.orig/arping.c iputils-s20100418/arping.c
14--- iputils-s20100418.orig/arping.c 2010-04-18 00:45:45.000000000 -0400
15+++ iputils-s20100418/arping.c 2010-08-04 19:52:08.441575956 -0400
16@@ -182,12 +182,17 @@
17 if (start.tv_sec==0)
18 start = tv;
19
20- if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500))
21+ if (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500)
22 finish();
23
24- if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
25+ if ((!timeout) && (count == 0))
26+ finish();
27+
28+ if ( count!=0 && (last.tv_sec==0 || MS_TDIFF(tv,last) > 500 ) ) {
29 send_pack(s, src, dst,
30 (struct sockaddr_ll *)&me, (struct sockaddr_ll *)&he);
31+ if (count >= 0)
32+ count--;
33 if (count == 0 && unsolicited)
34 finish();
35 }
36diff -Naur iputils-s20100418.orig/doc/Makefile iputils-s20100418/doc/Makefile
37--- iputils-s20100418.orig/doc/Makefile 2010-04-18 00:45:45.000000000 -0400
38+++ iputils-s20100418/doc/Makefile 2010-08-04 19:52:08.441575956 -0400
39@@ -6,7 +6,7 @@
40
41 html: $(HTMLFILES) iputils.html
42
43-man: $(MANFILES)
44+man: $(MANFILES) fix_sgml2man
45
46 # docbook scripts are incredibly dirty in the sense that they leak
47 # lots of some strange temporary junk directories and files.
48@@ -33,6 +33,9 @@
49 @set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
50 @-rm -rf tmp.db2man
51
52+fix_sgml2man:
53+ @sed -i -e 's!\\fB\\fIdestination\\fB\\fR \[\\fB/\\fIport\\fB\\fR\]!\\fB\\fIdestination\\fB\\fR[\\fB/\\fIport\\fB\\fR]!g' tracepath.8
54+
55 clean:
56 @rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html tmp.db2man
57
58diff -Naur iputils-s20100418.orig/doc/docbook2man-spec.pl iputils-s20100418/doc/docbook2man-spec.pl
59--- iputils-s20100418.orig/doc/docbook2man-spec.pl 2010-04-18 00:45:45.000000000 -0400
60+++ iputils-s20100418/doc/docbook2man-spec.pl 2010-08-04 19:52:08.438080809 -0400
61@@ -428,7 +428,7 @@
62 output ' ';
63
64 if($_[0]->attribute('CHOICE')->value =~ /opt/i) {
65- output '[ ';
66+ output '[';
67 }
68 bold_on();
69 }
70@@ -441,7 +441,7 @@
71 font_off();
72 }
73 if($_[0]->attribute('CHOICE')->value =~ /opt/i) {
74- output '] ';
75+ output ']';
76 }
77 }
78
79diff -Naur iputils-s20100418.orig/ping.c iputils-s20100418/ping.c
80--- iputils-s20100418.orig/ping.c 2010-04-18 00:45:45.000000000 -0400
81+++ iputils-s20100418/ping.c 2010-08-04 19:52:08.441575956 -0400
82@@ -250,7 +250,7 @@
83 if (argc == 1)
84 options |= F_NUMERIC;
85 } else {
86- hp = gethostbyname(target);
87+ hp = gethostbyname2(target, AF_INET);
88 if (!hp) {
89 fprintf(stderr, "ping: unknown host %s\n", target);
90 exit(2);
91@@ -883,9 +883,36 @@
92 case ICMP_SR_FAILED:
93 printf("Source Route Failed\n");
94 break;
95+ case ICMP_NET_UNKNOWN:
96+ printf("Destination Net Unknown\n");
97+ break;
98+ case ICMP_HOST_UNKNOWN:
99+ printf("Destination Host Unknown\n");
100+ break;
101+ case ICMP_HOST_ISOLATED:
102+ printf("Source Host Isolated\n");
103+ break;
104+ case ICMP_NET_ANO:
105+ printf("Destination Net Prohibited\n");
106+ break;
107+ case ICMP_HOST_ANO:
108+ printf("Destination Host Prohibited\n");
109+ break;
110+ case ICMP_NET_UNR_TOS:
111+ printf("Destination Net Unreachable for Type of Service\n");
112+ break;
113+ case ICMP_HOST_UNR_TOS:
114+ printf("Destination Host Unreachable for Type of Service\n");
115+ break;
116 case ICMP_PKT_FILTERED:
117 printf("Packet filtered\n");
118 break;
119+ case ICMP_PREC_VIOLATION:
120+ printf("Precedence Violation\n");
121+ break;
122+ case ICMP_PREC_CUTOFF:
123+ printf("Precedence Cutoff\n");
124+ break;
125 default:
126 printf("Dest Unreachable, Bad Code: %d\n", code);
127 break;
128@@ -1032,7 +1059,7 @@
129 i = j;
130 i -= IPOPT_MINOFF;
131 if (i <= 0)
132- continue;
133+ break;
134 if (i == old_rrlen
135 && !strncmp((char *)cp, old_rr, i)
136 && !(options & F_FLOOD)) {
137@@ -1069,7 +1096,7 @@
138 i = j;
139 i -= 5;
140 if (i <= 0)
141- continue;
142+ break;
143 flags = *++cp;
144 printf("\nTS: ");
145 cp++;
146diff -Naur iputils-s20100418.orig/ping_common.c iputils-s20100418/ping_common.c
147--- iputils-s20100418.orig/ping_common.c 2010-04-18 00:45:45.000000000 -0400
148+++ iputils-s20100418/ping_common.c 2010-08-04 19:52:08.433579291 -0400
149@@ -872,7 +872,8 @@
150 printf("%spipe %d", comma, pipesize);
151 comma = ", ";
152 }
153- if (ntransmitted > 1 && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
154+ if (ntransmitted > 1 && nreceived &&
155+ (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
156 int ipg = (1000000*(long long)tv.tv_sec+tv.tv_usec)/(ntransmitted-1);
157 printf("%sipg/ewma %d.%03d/%d.%03d ms",
158 comma, ipg/1000, ipg%1000, rtt/8000, (rtt/8)%1000);
159diff -Naur iputils-s20100418.orig/tracepath.c iputils-s20100418/tracepath.c
160--- iputils-s20100418.orig/tracepath.c 2010-04-18 00:45:45.000000000 -0400
161+++ iputils-s20100418/tracepath.c 2010-08-04 19:52:08.438080809 -0400
162@@ -338,9 +338,9 @@
163 base_port = atoi(p+1);
164 } else
165 base_port = 44444;
166- he = gethostbyname(argv[0]);
167+ he = gethostbyname2(argv[0], AF_INET);
168 if (he == NULL) {
169- herror("gethostbyname");
170+ herror("gethostbyname2");
171 exit(1);
172 }
173 memcpy(&target.sin_addr, he->h_addr, 4);
Note: See TracBrowser for help on using the repository browser.