- update to latest upstream
- enables flowlabel feature (-F option)
This commit is contained in:
parent
d0db1a1165
commit
f3f6691665
@ -1,3 +1,3 @@
|
|||||||
iputils-s20071127.tar.bz2
|
iputils-s20100418.tar.bz2
|
||||||
rdisc.initd
|
rdisc.initd
|
||||||
ifenslave.tar.gz
|
ifenslave.tar.gz
|
||||||
|
@ -32,9 +32,9 @@ diff -up iputils-s20071127/arping.c.ia64_align iputils-s20071127/arping.c
|
|||||||
diff -up iputils-s20071127/ping6.c.ia64_align iputils-s20071127/ping6.c
|
diff -up iputils-s20071127/ping6.c.ia64_align iputils-s20071127/ping6.c
|
||||||
--- iputils-s20071127/ping6.c.ia64_align 2008-06-02 08:56:32.000000000 +0200
|
--- iputils-s20071127/ping6.c.ia64_align 2008-06-02 08:56:32.000000000 +0200
|
||||||
+++ iputils-s20071127/ping6.c 2008-06-02 08:56:32.000000000 +0200
|
+++ iputils-s20071127/ping6.c 2008-06-02 08:56:32.000000000 +0200
|
||||||
@@ -256,7 +256,7 @@ int main(int argc, char *argv[])
|
@@ -581,7 +581,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
|
||||||
options |= F_STRICTSOURCE;
|
free(addr);
|
||||||
} else {
|
} else {
|
||||||
- device = optarg;
|
- device = optarg;
|
||||||
+ device = strdup(optarg);
|
+ device = strdup(optarg);
|
||||||
|
@ -1,6 +1,26 @@
|
|||||||
--- iputils-s20070202/ping.c.idn 2007-08-06 14:45:36.000000000 +0200
|
diff -up iputils-s20100418/Makefile.idn iputils-s20100418/Makefile
|
||||||
+++ iputils-s20070202/ping.c 2007-08-06 14:45:36.000000000 +0200
|
--- iputils-s20100418/Makefile.idn 2010-04-20 16:07:59.018479157 +0200
|
||||||
@@ -58,6 +58,9 @@
|
+++ iputils-s20100418/Makefile 2010-04-20 16:10:06.389481427 +0200
|
||||||
|
@@ -28,8 +28,13 @@ all: $(TARGETS)
|
||||||
|
|
||||||
|
tftpd: tftpd.o tftpsubs.o
|
||||||
|
-arping: arping.o -lsysfs
|
||||||
|
+arping: arping.o
|
||||||
|
+
|
||||||
|
ping: ping.o ping_common.o
|
||||||
|
-ping6: ping6.o ping_common.o -lresolv -lcrypto
|
||||||
|
+ $(CC) $(CFLAGS) ping.o ping_common.o -lidn -o ping
|
||||||
|
+
|
||||||
|
+ping6: ping6.o ping_common.o
|
||||||
|
+ $(CC) $(CFLAGS) ping6.o ping_common.o -lresolv -lcrypto -o ping6
|
||||||
|
+
|
||||||
|
ping.o ping6.o ping_common.o: ping_common.h
|
||||||
|
tftpd.o tftpsubs.o: tftp.h
|
||||||
|
|
||||||
|
diff -up iputils-s20100418/ping.c.idn iputils-s20100418/ping.c
|
||||||
|
--- iputils-s20100418/ping.c.idn 2010-04-20 16:07:59.038484302 +0200
|
||||||
|
+++ iputils-s20100418/ping.c 2010-04-20 16:07:59.077485007 +0200
|
||||||
|
@@ -58,6 +58,9 @@ char copyright[] =
|
||||||
* This program has to run SUID to ROOT to access the ICMP socket.
|
* This program has to run SUID to ROOT to access the ICMP socket.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -10,8 +30,8 @@
|
|||||||
#include "ping_common.h"
|
#include "ping_common.h"
|
||||||
|
|
||||||
#include <netinet/ip.h>
|
#include <netinet/ip.h>
|
||||||
@@ -122,6 +128,10 @@
|
@@ -123,6 +126,10 @@ main(int argc, char **argv)
|
||||||
char *target, hnamebuf[MAXHOSTNAMELEN];
|
char *target, hnamebuf[MAX_HOSTNAMELEN];
|
||||||
char rspace[3 + 4 * NROUTES + 1]; /* record route space */
|
char rspace[3 + 4 * NROUTES + 1]; /* record route space */
|
||||||
|
|
||||||
+ char *idn;
|
+ char *idn;
|
||||||
@ -21,10 +41,11 @@
|
|||||||
icmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
|
icmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
|
||||||
socket_errno = errno;
|
socket_errno = errno;
|
||||||
|
|
||||||
@@ -242,13 +254,27 @@
|
@@ -250,13 +257,27 @@ main(int argc, char **argv)
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
options |= F_NUMERIC;
|
options |= F_NUMERIC;
|
||||||
} else {
|
} else {
|
||||||
|
- hp = gethostbyname(target);
|
||||||
+ rc = idna_to_ascii_lz (target, &idn, 0);
|
+ rc = idna_to_ascii_lz (target, &idn, 0);
|
||||||
+ if (rc == IDNA_SUCCESS)
|
+ if (rc == IDNA_SUCCESS)
|
||||||
+ hp = gethostbyname (idn);
|
+ hp = gethostbyname (idn);
|
||||||
@ -33,12 +54,12 @@
|
|||||||
+ exit(2);
|
+ exit(2);
|
||||||
+ }
|
+ }
|
||||||
+ free(idn);
|
+ free(idn);
|
||||||
- hp = gethostbyname(target);
|
|
||||||
if (!hp) {
|
if (!hp) {
|
||||||
fprintf(stderr, "ping: unknown host %s\n", target);
|
fprintf(stderr, "ping: unknown host %s\n", target);
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
memcpy(&whereto.sin_addr, hp->h_addr, 4);
|
memcpy(&whereto.sin_addr, hp->h_addr, 4);
|
||||||
|
- strncpy(hnamebuf, hp->h_name, sizeof(hnamebuf) - 1);
|
||||||
+ rc = idna_to_unicode_lzlz (hp->h_name, &idn, 0);
|
+ rc = idna_to_unicode_lzlz (hp->h_name, &idn, 0);
|
||||||
+ if (rc == IDNA_SUCCESS)
|
+ if (rc == IDNA_SUCCESS)
|
||||||
+ strncpy(hnamebuf, idn, sizeof(hnamebuf) - 1);
|
+ strncpy(hnamebuf, idn, sizeof(hnamebuf) - 1);
|
||||||
@ -47,72 +68,19 @@
|
|||||||
+ exit(2);
|
+ exit(2);
|
||||||
+ }
|
+ }
|
||||||
+ free(idn);
|
+ free(idn);
|
||||||
- strncpy(hnamebuf, hp->h_name, sizeof(hnamebuf) - 1);
|
|
||||||
hnamebuf[sizeof(hnamebuf) - 1] = 0;
|
hnamebuf[sizeof(hnamebuf) - 1] = 0;
|
||||||
hostname = hnamebuf;
|
hostname = hnamebuf;
|
||||||
}
|
}
|
||||||
--- iputils-s20070202/Makefile.idn 2007-08-06 14:45:36.000000000 +0200
|
diff -up iputils-s20100418/ping_common.c.idn iputils-s20100418/ping_common.c
|
||||||
+++ iputils-s20070202/Makefile 2007-08-06 14:45:36.000000000 +0200
|
--- iputils-s20100418/ping_common.c.idn 2010-04-20 16:07:59.039478452 +0200
|
||||||
@@ -27,8 +27,13 @@
|
+++ iputils-s20100418/ping_common.c 2010-04-20 16:07:59.069478660 +0200
|
||||||
|
|
||||||
|
|
||||||
tftpd: tftpd.o tftpsubs.o
|
|
||||||
+
|
|
||||||
ping: ping.o ping_common.o
|
|
||||||
+ $(CC) $(CFLAGS) ping.o ping_common.o -lidn -o ping
|
|
||||||
+
|
|
||||||
ping6: ping6.o ping_common.o
|
|
||||||
+ $(CC) $(CFLAGS) ping6.o ping_common.o -o ping6
|
|
||||||
+
|
|
||||||
ping.o ping6.o ping_common.o: ping_common.h
|
|
||||||
tftpd.o tftpsubs.o: tftp.h
|
|
||||||
|
|
||||||
--- iputils-s20070202/ping6.c.idn 2007-08-06 14:45:36.000000000 +0200
|
|
||||||
+++ iputils-s20070202/ping6.c 2007-08-06 14:45:36.000000000 +0200
|
|
||||||
@@ -66,6 +66,9 @@
|
|
||||||
* More statistics could always be gathered.
|
|
||||||
* This program has to run SUID to ROOT to access the ICMP socket.
|
|
||||||
*/
|
|
||||||
+#define _GNU_SOURCE
|
|
||||||
+#include <locale.h>
|
|
||||||
+
|
|
||||||
#include "ping_common.h"
|
|
||||||
|
|
||||||
#include <linux/filter.h>
|
|
||||||
@@ -210,6 +216,8 @@
|
|
||||||
int err, csum_offset, sz_opt;
|
|
||||||
static uint32_t scope_id = 0;
|
|
||||||
|
|
||||||
+ setlocale(LC_ALL, "");
|
|
||||||
+
|
|
||||||
icmp_sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
|
|
||||||
socket_errno = errno;
|
|
||||||
|
|
||||||
@@ -296,6 +306,7 @@
|
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
|
||||||
hints.ai_family = AF_INET6;
|
|
||||||
+ hints.ai_flags = AI_IDN;
|
|
||||||
gai = getaddrinfo(target, NULL, &hints, &ai);
|
|
||||||
if (gai) {
|
|
||||||
fprintf(stderr, "unknown host\n");
|
|
||||||
@@ -328,6 +341,7 @@
|
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
|
||||||
hints.ai_family = AF_INET6;
|
|
||||||
+ hints.ai_flags = AI_IDN;
|
|
||||||
gai = getaddrinfo(target, NULL, &hints, &ai);
|
|
||||||
if (gai) {
|
|
||||||
fprintf(stderr, "unknown host\n");
|
|
||||||
--- iputils-s20070202/ping_common.c.idn 2007-08-06 14:45:36.000000000 +0200
|
|
||||||
+++ iputils-s20070202/ping_common.c 2007-08-06 14:47:41.000000000 +0200
|
|
||||||
@@ -1,3 +1,5 @@
|
@@ -1,3 +1,5 @@
|
||||||
+#include <locale.h>
|
+#include <locale.h>
|
||||||
+
|
+
|
||||||
#include "ping_common.h"
|
#include "ping_common.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
@@ -97,6 +102,7 @@
|
@@ -98,6 +100,7 @@ static void fill(char *patp)
|
||||||
|
|
||||||
void common_options(int ch)
|
void common_options(int ch)
|
||||||
{
|
{
|
||||||
@ -120,7 +88,7 @@
|
|||||||
switch(ch) {
|
switch(ch) {
|
||||||
case 'a':
|
case 'a':
|
||||||
options |= F_AUDIBLE;
|
options |= F_AUDIBLE;
|
||||||
@@ -222,6 +230,7 @@
|
@@ -242,6 +245,7 @@ void common_options(int ch)
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
diff -up iputils-s20071127/rdisc.c.open_max iputils-s20071127/rdisc.c
|
|
||||||
--- iputils-s20071127/rdisc.c.open_max 2008-02-25 11:15:37.000000000 +0100
|
|
||||||
+++ iputils-s20071127/rdisc.c 2008-02-25 11:17:30.000000000 +0100
|
|
||||||
@@ -240,14 +240,25 @@ void do_fork(void)
|
|
||||||
{
|
|
||||||
int t;
|
|
||||||
pid_t pid;
|
|
||||||
+ long open_max;
|
|
||||||
|
|
||||||
if (trace)
|
|
||||||
return;
|
|
||||||
+ if ((open_max = sysconf(_SC_OPEN_MAX)) == -1) {
|
|
||||||
+ if (errno == 0) {
|
|
||||||
+ (void) fprintf(stderr, "OPEN_MAX is not supported\n");
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ (void) fprintf(stderr, "sysconf() error\n");
|
|
||||||
+ }
|
|
||||||
+ exit(1);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
|
|
||||||
if ((pid=fork()) != 0)
|
|
||||||
exit(0);
|
|
||||||
|
|
||||||
- for (t = 0; t < OPEN_MAX; t++)
|
|
||||||
+ for (t = 0; t < open_max; t++)
|
|
||||||
if (t != s)
|
|
||||||
close(t);
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
diff -up iputils-s20071127/ping6.c.corr_type iputils-s20071127/ping6.c
|
diff -up iputils-s20100418/ping6.c.corr_type iputils-s20100418/ping6.c
|
||||||
--- iputils-s20071127/ping6.c.corr_type 2009-02-16 14:47:29.000000000 +0100
|
--- iputils-s20100418/ping6.c.corr_type 2010-04-20 15:42:39.181245576 +0200
|
||||||
+++ iputils-s20071127/ping6.c 2009-02-18 09:12:46.000000000 +0100
|
+++ iputils-s20100418/ping6.c 2010-04-20 15:42:39.198230879 +0200
|
||||||
@@ -775,7 +775,7 @@ parse_reply(struct msghdr *msg, int cc,
|
@@ -1335,7 +1335,7 @@ parse_reply(struct msghdr *msg, int cc,
|
||||||
#endif
|
#endif
|
||||||
if (c->cmsg_len < CMSG_LEN(sizeof(int)))
|
if (c->cmsg_len < CMSG_LEN(sizeof(int)))
|
||||||
continue;
|
continue;
|
||||||
@ -10,10 +10,10 @@ diff -up iputils-s20071127/ping6.c.corr_type iputils-s20071127/ping6.c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
diff -up iputils-s20071127/ping.c.corr_type iputils-s20071127/ping.c
|
diff -up iputils-s20100418/ping.c.corr_type iputils-s20100418/ping.c
|
||||||
--- iputils-s20071127/ping.c.corr_type 2009-02-16 13:58:38.000000000 +0100
|
--- iputils-s20100418/ping.c.corr_type 2010-04-20 15:42:39.193242030 +0200
|
||||||
+++ iputils-s20071127/ping.c 2009-02-16 14:22:49.000000000 +0100
|
+++ iputils-s20100418/ping.c 2010-04-20 15:42:39.199231317 +0200
|
||||||
@@ -1193,18 +1193,20 @@ pr_addr(__u32 addr)
|
@@ -1211,18 +1211,20 @@ pr_addr(__u32 addr)
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
static char buf[4096];
|
static char buf[4096];
|
||||||
static __u32 addr_cache = 0;
|
static __u32 addr_cache = 0;
|
||||||
@ -36,10 +36,10 @@ diff -up iputils-s20071127/ping.c.corr_type iputils-s20071127/ping.c
|
|||||||
return(buf);
|
return(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
diff -up iputils-s20071127/rdisc.c.corr_type iputils-s20071127/rdisc.c
|
diff -up iputils-s20100418/rdisc.c.corr_type iputils-s20100418/rdisc.c
|
||||||
--- iputils-s20071127/rdisc.c.corr_type 2009-02-18 11:04:14.000000000 +0100
|
--- iputils-s20100418/rdisc.c.corr_type 2010-04-18 06:45:45.000000000 +0200
|
||||||
+++ iputils-s20071127/rdisc.c 2009-02-18 13:32:41.000000000 +0100
|
+++ iputils-s20100418/rdisc.c 2010-04-20 15:42:39.201230377 +0200
|
||||||
@@ -1476,14 +1476,19 @@ rtioctl(struct in_addr addr, int op)
|
@@ -1487,14 +1487,19 @@ rtioctl(struct in_addr addr, int op)
|
||||||
{
|
{
|
||||||
int sock;
|
int sock;
|
||||||
struct rtentry rt;
|
struct rtentry rt;
|
||||||
@ -62,22 +62,22 @@ diff -up iputils-s20071127/rdisc.c.corr_type iputils-s20071127/rdisc.c
|
|||||||
rt.rt_flags = RTF_UP | RTF_GATEWAY;
|
rt.rt_flags = RTF_UP | RTF_GATEWAY;
|
||||||
|
|
||||||
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||||
diff -up iputils-s20071127/tracepath6.c.corr_type iputils-s20071127/tracepath6.c
|
diff -up iputils-s20100418/tracepath6.c.corr_type iputils-s20100418/tracepath6.c
|
||||||
--- iputils-s20071127/tracepath6.c.corr_type 2009-02-18 13:57:54.000000000 +0100
|
--- iputils-s20100418/tracepath6.c.corr_type 2010-04-18 06:45:45.000000000 +0200
|
||||||
+++ iputils-s20071127/tracepath6.c 2009-02-18 13:58:47.000000000 +0100
|
+++ iputils-s20100418/tracepath6.c 2010-04-20 15:44:15.129480911 +0200
|
||||||
@@ -126,7 +126,7 @@ restart:
|
@@ -173,7 +173,7 @@ restart:
|
||||||
#ifdef IPV6_2292HOPLIMIT
|
#ifdef IPV6_2292HOPLIMIT
|
||||||
case IPV6_2292HOPLIMIT:
|
case IPV6_2292HOPLIMIT:
|
||||||
#endif
|
#endif
|
||||||
- rethops = *(int*)CMSG_DATA(cmsg);
|
- rethops = *(int*)CMSG_DATA(cmsg);
|
||||||
+ memcpy(&rethops, CMSG_DATA(cmsg), sizeof (int));
|
+ memcpy(&rethops, CMSG_DATA(cmsg), sizeof (int));
|
||||||
break;
|
break;
|
||||||
}
|
default:
|
||||||
} else if (cmsg->cmsg_level == SOL_IP) {
|
printf("cmsg6:%d\n ", cmsg->cmsg_type);
|
||||||
diff -up iputils-s20071127/tracepath.c.corr_type iputils-s20071127/tracepath.c
|
diff -up iputils-s20100418/tracepath.c.corr_type iputils-s20100418/tracepath.c
|
||||||
--- iputils-s20071127/tracepath.c.corr_type 2009-02-18 13:53:20.000000000 +0100
|
--- iputils-s20100418/tracepath.c.corr_type 2010-04-18 06:45:45.000000000 +0200
|
||||||
+++ iputils-s20071127/tracepath.c 2009-02-18 13:50:24.000000000 +0100
|
+++ iputils-s20100418/tracepath.c 2010-04-20 15:42:39.203240403 +0200
|
||||||
@@ -128,7 +128,7 @@ restart:
|
@@ -145,7 +145,7 @@ restart:
|
||||||
if (cmsg->cmsg_type == IP_RECVERR) {
|
if (cmsg->cmsg_type == IP_RECVERR) {
|
||||||
e = (struct sock_extended_err *) CMSG_DATA(cmsg);
|
e = (struct sock_extended_err *) CMSG_DATA(cmsg);
|
||||||
} else if (cmsg->cmsg_type == IP_TTL) {
|
} else if (cmsg->cmsg_type == IP_TTL) {
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
diff -up iputils-s20071127/ping_common.c.output iputils-s20071127/ping_common.c
|
|
||||||
--- iputils-s20071127/ping_common.c.output 2008-02-26 14:12:02.000000000 +0100
|
|
||||||
+++ iputils-s20071127/ping_common.c 2008-02-26 14:24:34.000000000 +0100
|
|
||||||
@@ -791,8 +791,10 @@ static long llsqrt(long long a)
|
|
||||||
*/
|
|
||||||
void finish(void)
|
|
||||||
{
|
|
||||||
- struct timeval tv = cur_time;
|
|
||||||
+ struct timeval tv;
|
|
||||||
+ char *comma = "";
|
|
||||||
|
|
||||||
+ gettimeofday(&tv, NULL);
|
|
||||||
tvsub(&tv, &start_time);
|
|
||||||
|
|
||||||
putchar('\n');
|
|
||||||
@@ -827,12 +829,15 @@ void finish(void)
|
|
||||||
(long)tmax/1000, (long)tmax%1000,
|
|
||||||
(long)tmdev/1000, (long)tmdev%1000
|
|
||||||
);
|
|
||||||
+ comma = ", ";
|
|
||||||
+ }
|
|
||||||
+ if (pipesize > 1) {
|
|
||||||
+ printf("%spipe %d", comma, pipesize);
|
|
||||||
+ comma = ", ";
|
|
||||||
}
|
|
||||||
- if (pipesize > 1)
|
|
||||||
- printf(", pipe %d", pipesize);
|
|
||||||
if (ntransmitted > 1 && nreceived && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
|
|
||||||
int ipg = (1000000*(long long)tv.tv_sec+tv.tv_usec)/(ntransmitted-1);
|
|
||||||
- printf(", ipg/ewma %d.%03d/%d.%03d ms",
|
|
||||||
+ printf("%sipg/ewma %d.%03d/%d.%03d ms", comma,
|
|
||||||
ipg/1000, ipg%1000, rtt/8000, (rtt/8)%1000);
|
|
||||||
}
|
|
||||||
putchar('\n');
|
|
@ -1,71 +0,0 @@
|
|||||||
diff -up iputils-s20071127/arping.c.timeout iputils-s20071127/arping.c
|
|
||||||
--- iputils-s20071127/arping.c.timeout 2010-03-04 17:29:38.723487588 +0100
|
|
||||||
+++ iputils-s20071127/arping.c 2010-03-04 17:36:32.586489670 +0100
|
|
||||||
@@ -44,8 +44,7 @@ struct in_addr src, dst;
|
|
||||||
char *target;
|
|
||||||
int dad, unsolicited, advert;
|
|
||||||
int quiet;
|
|
||||||
-int count;
|
|
||||||
-int forever = 1;
|
|
||||||
+int count=-1;
|
|
||||||
int timeout;
|
|
||||||
int unicasting;
|
|
||||||
int s;
|
|
||||||
@@ -59,10 +58,10 @@ int broadcast_only;
|
|
||||||
struct sockaddr_ll me[2];
|
|
||||||
struct sockaddr_ll he[2];
|
|
||||||
|
|
||||||
-struct timeval last;
|
|
||||||
+struct timeval start, last;
|
|
||||||
|
|
||||||
int sent, brd_sent;
|
|
||||||
-int received, brd_recv, req_recv;
|
|
||||||
+int received=0, brd_recv, req_recv;
|
|
||||||
|
|
||||||
#define SYSFS_MNT_PATH "/sys"
|
|
||||||
#define SYSFS_CLASS "class"
|
|
||||||
@@ -179,14 +178,14 @@ void catcher(void)
|
|
||||||
|
|
||||||
gettimeofday(&tv, NULL);
|
|
||||||
|
|
||||||
- if (!forever && count == 0) {
|
|
||||||
- if (timeout && MS_TDIFF(tv, last) > timeout * 1000 + 500)
|
|
||||||
- finish();
|
|
||||||
- else if (!timeout)
|
|
||||||
- finish();
|
|
||||||
- }
|
|
||||||
+ if (start.tv_sec==0)
|
|
||||||
+ start = tv;
|
|
||||||
|
|
||||||
- if ((count > 0 || forever) && (last.tv_sec == 0 || MS_TDIFF(tv, last) > 500)) {
|
|
||||||
+ if ((timeout && MS_TDIFF(tv,start) > timeout*1000 + 500) ||
|
|
||||||
+ ((count == 0) && (!timeout)))
|
|
||||||
+ finish();
|
|
||||||
+
|
|
||||||
+ if (last.tv_sec == 0 || MS_TDIFF(tv, last) > 500) {
|
|
||||||
count--;
|
|
||||||
send_pack(s, src, dst, &me[0], &he[0]);
|
|
||||||
if (count == 0 && unsolicited)
|
|
||||||
@@ -405,10 +404,6 @@ main(int argc, char **argv)
|
|
||||||
break;
|
|
||||||
case 'c':
|
|
||||||
count = atoi(optarg);
|
|
||||||
- if (count > 0)
|
|
||||||
- forever = 0;
|
|
||||||
- else
|
|
||||||
- forever = 1;
|
|
||||||
break;
|
|
||||||
case 'w':
|
|
||||||
timeout = atoi(optarg);
|
|
||||||
@@ -610,8 +605,9 @@ main(int argc, char **argv)
|
|
||||||
sigaddset(&sset, SIGALRM);
|
|
||||||
sigaddset(&sset, SIGINT);
|
|
||||||
sigprocmask(SIG_BLOCK, &sset, &osset);
|
|
||||||
- if (recv_pack(packet, cc, from) && count == 0 && !forever)
|
|
||||||
- finish();
|
|
||||||
+ recv_pack(packet, cc, &from[0]);
|
|
||||||
+ if(received == count)
|
|
||||||
+ exit(0);
|
|
||||||
sigprocmask(SIG_SETMASK, &osset, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
diff -up iputils-s20071127/doc/tracepath.sgml.typing_bug iputils-s20071127/doc/tracepath.sgml
|
|
||||||
--- iputils-s20071127/doc/tracepath.sgml.typing_bug 2008-08-05 15:29:51.000000000 +0200
|
|
||||||
+++ iputils-s20071127/doc/tracepath.sgml 2008-08-05 15:30:12.000000000 +0200
|
|
||||||
@@ -99,7 +99,7 @@ with TTL of 2 was rejected at the first
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
-Te last line summarizes information about all the path to the destination,
|
|
||||||
+The last line summarizes information about all the path to the destination,
|
|
||||||
it shows detected Path MTU, amount of hops to the destination and our
|
|
||||||
guess about amount of hops from the destination to us, which can be
|
|
||||||
different when the path is asymmetric.
|
|
@ -46,7 +46,7 @@ diff -up iputils-s20071127/clockdiff.c.warnings iputils-s20071127/clockdiff.c
|
|||||||
diff -up iputils-s20071127/ping6.c.warnings iputils-s20071127/ping6.c
|
diff -up iputils-s20071127/ping6.c.warnings iputils-s20071127/ping6.c
|
||||||
--- iputils-s20071127/ping6.c.warnings 2008-06-02 13:30:06.000000000 +0200
|
--- iputils-s20071127/ping6.c.warnings 2008-06-02 13:30:06.000000000 +0200
|
||||||
+++ iputils-s20071127/ping6.c 2008-06-02 13:31:14.000000000 +0200
|
+++ iputils-s20071127/ping6.c 2008-06-02 13:31:14.000000000 +0200
|
||||||
@@ -667,7 +667,7 @@ int receive_error_msg()
|
@@ -1037,7 +1037,7 @@ int receive_error_msg()
|
||||||
if (options & F_QUIET)
|
if (options & F_QUIET)
|
||||||
goto out;
|
goto out;
|
||||||
if (options & F_FLOOD)
|
if (options & F_FLOOD)
|
||||||
@ -55,16 +55,16 @@ diff -up iputils-s20071127/ping6.c.warnings iputils-s20071127/ping6.c
|
|||||||
else if (e->ee_errno != EMSGSIZE)
|
else if (e->ee_errno != EMSGSIZE)
|
||||||
fprintf(stderr, "ping: local error: %s\n", strerror(e->ee_errno));
|
fprintf(stderr, "ping: local error: %s\n", strerror(e->ee_errno));
|
||||||
else
|
else
|
||||||
@@ -690,7 +690,7 @@ int receive_error_msg()
|
@@ -1060,7 +1060,7 @@ int receive_error_msg()
|
||||||
if (options & F_QUIET)
|
if (options & F_QUIET)
|
||||||
goto out;
|
goto out;
|
||||||
if (options & F_FLOOD) {
|
if (options & F_FLOOD) {
|
||||||
- write(STDOUT_FILENO, "\bE", 2);
|
- write(STDOUT_FILENO, "\bE", 2);
|
||||||
+ printf("\bE");
|
+ printf("\bE");
|
||||||
} else {
|
} else {
|
||||||
|
print_timestamp();
|
||||||
printf("From %s icmp_seq=%u ", pr_addr(&sin6->sin6_addr), ntohs(icmph.icmp6_seq));
|
printf("From %s icmp_seq=%u ", pr_addr(&sin6->sin6_addr), ntohs(icmph.icmp6_seq));
|
||||||
pr_icmph(e->ee_type, e->ee_code, e->ee_info);
|
@@ -1400,7 +1400,7 @@ parse_reply(struct msghdr *msg, int cc,
|
||||||
@@ -838,7 +838,7 @@ parse_reply(struct msghdr *msg, int cc,
|
|
||||||
return 0;
|
return 0;
|
||||||
nerrors++;
|
nerrors++;
|
||||||
if (options & F_FLOOD) {
|
if (options & F_FLOOD) {
|
||||||
@ -72,7 +72,7 @@ diff -up iputils-s20071127/ping6.c.warnings iputils-s20071127/ping6.c
|
|||||||
+ printf("\bE");
|
+ printf("\bE");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
printf("From %s: icmp_seq=%u ", pr_addr(&from->sin6_addr), ntohs(icmph1->icmp6_seq));
|
print_timestamp();
|
||||||
diff -up iputils-s20071127/ping.c.warnings iputils-s20071127/ping.c
|
diff -up iputils-s20071127/ping.c.warnings iputils-s20071127/ping.c
|
||||||
--- iputils-s20071127/ping.c.warnings 2008-06-02 13:29:27.000000000 +0200
|
--- iputils-s20071127/ping.c.warnings 2008-06-02 13:29:27.000000000 +0200
|
||||||
+++ iputils-s20071127/ping.c 2008-06-02 13:29:27.000000000 +0200
|
+++ iputils-s20071127/ping.c 2008-06-02 13:29:27.000000000 +0200
|
||||||
@ -101,8 +101,8 @@ diff -up iputils-s20071127/ping.c.warnings iputils-s20071127/ping.c
|
|||||||
- write(STDOUT_FILENO, "\bE", 2);
|
- write(STDOUT_FILENO, "\bE", 2);
|
||||||
+ printf("\bE");
|
+ printf("\bE");
|
||||||
} else {
|
} else {
|
||||||
|
print_timestamp();
|
||||||
printf("From %s icmp_seq=%u ", pr_addr(sin->sin_addr.s_addr), ntohs(icmph.un.echo.sequence));
|
printf("From %s icmp_seq=%u ", pr_addr(sin->sin_addr.s_addr), ntohs(icmph.un.echo.sequence));
|
||||||
pr_icmph(e->ee_type, e->ee_code, e->ee_info, NULL);
|
|
||||||
@@ -795,7 +795,7 @@ parse_reply(struct msghdr *msg, int cc,
|
@@ -795,7 +795,7 @@ parse_reply(struct msghdr *msg, int cc,
|
||||||
return !error_pkt;
|
return !error_pkt;
|
||||||
if (options & F_FLOOD) {
|
if (options & F_FLOOD) {
|
||||||
@ -111,7 +111,7 @@ diff -up iputils-s20071127/ping.c.warnings iputils-s20071127/ping.c
|
|||||||
+ printf("\bE");
|
+ printf("\bE");
|
||||||
return !error_pkt;
|
return !error_pkt;
|
||||||
}
|
}
|
||||||
printf("From %s: icmp_seq=%u ",
|
print_timestamp();
|
||||||
@@ -812,9 +812,9 @@ parse_reply(struct msghdr *msg, int cc,
|
@@ -812,9 +812,9 @@ parse_reply(struct msghdr *msg, int cc,
|
||||||
}
|
}
|
||||||
if ((options & F_FLOOD) && !(options & (F_VERBOSE|F_QUIET))) {
|
if ((options & F_FLOOD) && !(options & (F_VERBOSE|F_QUIET))) {
|
||||||
|
@ -40,11 +40,11 @@
|
|||||||
--- iputils/ping_common.c.OLD 2006-02-06 10:34:35.000000000 +0100
|
--- iputils/ping_common.c.OLD 2006-02-06 10:34:35.000000000 +0100
|
||||||
+++ iputils/ping_common.c 2006-02-06 10:34:35.000000000 +0100
|
+++ iputils/ping_common.c 2006-02-06 10:34:35.000000000 +0100
|
||||||
@@ -819,7 +819,7 @@
|
@@ -819,7 +819,7 @@
|
||||||
}
|
printf("%spipe %d", comma, pipesize);
|
||||||
if (pipesize > 1)
|
comma = ", ";
|
||||||
printf(", pipe %d", pipesize);
|
}
|
||||||
- if (ntransmitted > 1 && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
|
- if (ntransmitted > 1 && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
|
||||||
+ if (ntransmitted > 1 && nreceived && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
|
+ if (ntransmitted > 1 && nreceived && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
|
||||||
int ipg = (1000000*(long long)tv.tv_sec+tv.tv_usec)/(ntransmitted-1);
|
int ipg = (1000000*(long long)tv.tv_sec+tv.tv_usec)/(ntransmitted-1);
|
||||||
printf(", ipg/ewma %d.%03d/%d.%03d ms",
|
printf("%sipg/ewma %d.%03d/%d.%03d ms",
|
||||||
ipg/1000, ipg%1000, rtt/8000, (rtt/8)%1000);
|
comma, ipg/1000, ipg%1000, rtt/8000, (rtt/8)%1000);
|
||||||
|
52
iputils.spec
52
iputils.spec
@ -1,7 +1,7 @@
|
|||||||
Summary: Network monitoring tools including ping
|
Summary: Network monitoring tools including ping
|
||||||
Name: iputils
|
Name: iputils
|
||||||
Version: 20071127
|
Version: 20100418
|
||||||
Release: 10%{?dist}
|
Release: 1%{?dist}
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: http://www.skbuff.net/iputils
|
URL: http://www.skbuff.net/iputils
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
@ -16,17 +16,14 @@ Patch2: iputils-20020927-addrcache.patch
|
|||||||
Patch3: iputils-20020927-ping-subint.patch
|
Patch3: iputils-20020927-ping-subint.patch
|
||||||
Patch4: iputils-ping_cleanup.patch
|
Patch4: iputils-ping_cleanup.patch
|
||||||
Patch5: iputils-ifenslave.patch
|
Patch5: iputils-ifenslave.patch
|
||||||
Patch6: iputils-20020927-arping-infiniband.patch
|
Patch6: iputils-20070202-idn.patch
|
||||||
Patch7: iputils-20070202-idn.patch
|
Patch7: iputils-20070202-traffic_class.patch
|
||||||
Patch8: iputils-20070202-open-max.patch
|
Patch8: iputils-20070202-ia64_align.patch
|
||||||
Patch9: iputils-20070202-traffic_class.patch
|
Patch9: iputils-20071127-warnings.patch
|
||||||
Patch10: iputils-20070202-arping_timeout.patch
|
Patch10: iputils-20071127-corr_type.patch
|
||||||
Patch11: iputils-20071127-output.patch
|
Patch11: iputils-20071127-infiniband.patch
|
||||||
Patch12: iputils-20070202-ia64_align.patch
|
Patch12: iputils-20100418-convtoint.patch
|
||||||
Patch13: iputils-20071127-warnings.patch
|
Patch13: iputils-20100418-flowlabel.patch
|
||||||
Patch14: iputils-20071127-typing_bug.patch
|
|
||||||
Patch15: iputils-20071127-corr_type.patch
|
|
||||||
Patch16: iputils-20071127-timeout.patch
|
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
BuildRequires: docbook-utils perl-SGMLSpm
|
BuildRequires: docbook-utils perl-SGMLSpm
|
||||||
@ -52,25 +49,22 @@ the target machine is alive and receiving network traffic.
|
|||||||
%patch3 -p1 -b .ping-subint
|
%patch3 -p1 -b .ping-subint
|
||||||
%patch4 -p1 -b .cleanup
|
%patch4 -p1 -b .cleanup
|
||||||
%patch5 -p1 -b .addr
|
%patch5 -p1 -b .addr
|
||||||
%patch6 -p1 -b .infiniband
|
%patch6 -p1 -b .idn
|
||||||
%patch7 -p1 -b .idn
|
%patch7 -p1 -b .traffic_class
|
||||||
%patch8 -p1 -b .open-max
|
%patch8 -p1 -b .ia64_align
|
||||||
%patch9 -p1 -b .traffic_class
|
%patch9 -p1 -b .warnings
|
||||||
%patch10 -p1 -b .arping_timeout
|
%patch10 -p1 -b .corr_type
|
||||||
%patch11 -p1 -b .output
|
%patch11 -p1 -b .infiniband
|
||||||
%patch12 -p1 -b .ia64_align
|
%patch12 -p1 -b .convtoint
|
||||||
%patch13 -p1 -b .warnings
|
%patch13 -p1 -b .flowlabel
|
||||||
%patch14 -p1 -b .typing_bug
|
|
||||||
%patch15 -p1 -b .corr_type
|
|
||||||
%patch16 -p1 -b .timeout
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%ifarch s390 s390x
|
%ifarch s390 s390x
|
||||||
export CFLAGS="$RPM_OPT_FLAGS -fPIE -Werror"
|
export CFLAGS="$RPM_OPT_FLAGS -fPIE -Werror -D_GNU_SOURCE -fno-strict-aliasing"
|
||||||
%else
|
%else
|
||||||
export CFLAGS="$RPM_OPT_FLAGS -fpie -Werror"
|
export CFLAGS="$RPM_OPT_FLAGS -fpie -Werror -D_GNU_SOURCE -fno-strict-aliasing"
|
||||||
%endif
|
%endif
|
||||||
export LDFLAGS="-pie"
|
export LDFLAGS="-pie "
|
||||||
make %{?_smp_mflags} arping clockdiff ping ping6 rdisc tracepath tracepath6
|
make %{?_smp_mflags} arping clockdiff ping ping6 rdisc tracepath tracepath6
|
||||||
gcc -Wall $RPM_OPT_FLAGS ifenslave.c -o ifenslave
|
gcc -Wall $RPM_OPT_FLAGS ifenslave.c -o ifenslave
|
||||||
make -C doc man
|
make -C doc man
|
||||||
@ -152,6 +146,10 @@ rm -rf ${RPM_BUILD_ROOT}
|
|||||||
%{_sysconfdir}/rc.d/init.d/rdisc
|
%{_sysconfdir}/rc.d/init.d/rdisc
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Apr 20 2010 Jiri Skala <jskala@redhat.com> - 20100418-1
|
||||||
|
- update to latest upstream
|
||||||
|
- enables flowlabel feature (-F option)
|
||||||
|
|
||||||
* Fri Mar 05 2010 Jiri Skala <jskala@redhat.com> - 20071127-10
|
* Fri Mar 05 2010 Jiri Skala <jskala@redhat.com> - 20071127-10
|
||||||
- fixes #557308 - arping ignores the deadline option
|
- fixes #557308 - arping ignores the deadline option
|
||||||
|
|
||||||
|
2
sources
2
sources
@ -1,3 +1,3 @@
|
|||||||
12245e9927d60ff5cf4a99d265bcb7d3 iputils-s20071127.tar.bz2
|
df6b0062118cdc5c62e3c810f831e976 iputils-s20100418.tar.bz2
|
||||||
b044213f027e70a2cc1aa882e21fba3b rdisc.initd
|
b044213f027e70a2cc1aa882e21fba3b rdisc.initd
|
||||||
844b2f725aecec243c675abff7d1fe1f ifenslave.tar.gz
|
844b2f725aecec243c675abff7d1fe1f ifenslave.tar.gz
|
||||||
|
Loading…
Reference in New Issue
Block a user