Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F158774758
D39126.id118935.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
21 KB
Referenced Files
None
Subscribers
None
D39126.id118935.diff
View Options
diff --git a/sbin/ping/main.h b/sbin/ping/main.h
--- a/sbin/ping/main.h
+++ b/sbin/ping/main.h
@@ -51,6 +51,23 @@
#endif
#define PING6OPTS ".::6Aab:C:c:Dde:fHI:i:k:l:m:nNoOp:qS:s:t:uvyYW:z:" PING6ADDOPTS
+/* various options */
+extern char *hostname;
+
+/* counters */
+extern long nreceived; /* # of packets we got back */
+extern long nrepeats; /* number of duplicates */
+extern long ntransmitted; /* sequence # for outbound packets = #sent */
+extern long nrcvtimeout; /* # of packets we got back after waittime */
+
+/* timing */
+extern int timing; /* flag to do timing */
+extern double tmin; /* minimum round trip time */
+extern double tmax; /* maximum round trip time */
+extern double tsum; /* sum of all times, for doing average */
+extern double tsumsq; /* sum of all times squared, for std. dev. */
+
+void pr_summary(FILE * __restrict);
void usage(void) __dead2;
#endif
diff --git a/sbin/ping/main.c b/sbin/ping/main.c
--- a/sbin/ping/main.c
+++ b/sbin/ping/main.c
@@ -37,6 +37,7 @@
#include <netinet/in.h>
#include <err.h>
+#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -61,6 +62,22 @@
#error At least one of INET and INET6 is required
#endif
+/* various options */
+char *hostname;
+
+/* counters */
+long nreceived; /* # of packets we got back */
+long nrepeats; /* number of duplicates */
+long ntransmitted; /* sequence # for outbound packets = #sent */
+long nrcvtimeout = 0; /* # of packets we got back after waittime */
+
+/* timing */
+int timing; /* flag to do timing */
+double tmin = 999999999.0; /* minimum round trip time */
+double tmax = 0.0; /* maximum round trip time */
+double tsum = 0.0; /* sum of all times, for doing average */
+double tsumsq = 0.0; /* sum of all times squared, for std. dev. */
+
int
main(int argc, char *argv[])
{
@@ -172,6 +189,41 @@
errx(1, "Unknown host");
}
+/*
+ * pr_summary --
+ * Print out summary statistics to the given output stream.
+ */
+void
+pr_summary(FILE * restrict stream)
+{
+ fprintf(stream, "\n--- %s ping statistics ---\n", hostname);
+ fprintf(stream, "%ld packets transmitted, ", ntransmitted);
+ fprintf(stream, "%ld packets received, ", nreceived);
+ if (nrepeats)
+ fprintf(stream, "+%ld duplicates, ", nrepeats);
+ if (ntransmitted) {
+ if (nreceived > ntransmitted)
+ fprintf(stream, "-- somebody's duplicating packets!");
+ else
+ fprintf(stream, "%.1f%% packet loss",
+ ((((double)ntransmitted - nreceived) * 100.0) /
+ ntransmitted));
+ }
+ if (nrcvtimeout)
+ fprintf(stream, ", %ld packets out of wait time", nrcvtimeout);
+ fputc('\n', stream);
+ if (nreceived && timing) {
+ /* Only display average to microseconds */
+ double num = nreceived + nrepeats;
+ double avg = tsum / num;
+ double dev = sqrt(fmax(0, tsumsq / num - avg * avg));
+ fprintf(stream,
+ "round-trip min/avg/max/stddev = %.3f/%.3f/%.3f/%.3f ms\n",
+ tmin, avg, tmax, dev);
+ }
+ fflush(stream);
+}
+
void
usage(void)
{
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -89,7 +89,6 @@
#include <ctype.h>
#include <err.h>
#include <errno.h>
-#include <math.h>
#include <netdb.h>
#include <stddef.h>
#include <signal.h>
@@ -180,7 +179,6 @@
static const char *DOT = ".";
static size_t DOTlen = 1;
static size_t DOTidx = 0;
-static char *hostname;
static char *shostname;
static int ident; /* process id to identify our packets */
static int uid; /* cached uid for micro-optimization */
@@ -192,9 +190,6 @@
/* counters */
static long nmissedmax; /* max value of ntransmitted - nreceived - 1 */
static long npackets; /* max packets to transmit */
-static long nreceived; /* # of packets we got back */
-static long nrepeats; /* number of duplicates */
-static long ntransmitted; /* sequence # for outbound packets = #sent */
static long snpackets; /* max packets to transmit in one sweep */
static long sntransmitted; /* # of packets we sent in this sweep */
static int sweepmax; /* max value of payload in sweep */
@@ -202,33 +197,25 @@
static int sweepincr = 1; /* payload increment in sweep */
static int interval = 1000; /* interval between packets, ms */
static int waittime = MAXWAIT; /* timeout for each packet */
-static long nrcvtimeout = 0; /* # of packets we got back after waittime */
-
-/* timing */
-static int timing; /* flag to do timing */
-static double tmin = 999999999.0; /* minimum round trip time */
-static double tmax = 0.0; /* maximum round trip time */
-static double tsum = 0.0; /* sum of all times, for doing average */
-static double tsumsq = 0.0; /* sum of all times squared, for std. dev. */
/* nonzero if we've been told to finish up */
-static volatile sig_atomic_t finish_up;
-static volatile sig_atomic_t siginfo_p;
+static volatile sig_atomic_t seenint;
+#ifdef SIGINFO
+static volatile sig_atomic_t seeninfo;
+#endif
static cap_channel_t *capdns;
static void fill(char *, char *);
static cap_channel_t *capdns_setup(void);
-static void check_status(void);
-static void finish(void) __dead2;
+static void onint(int);
+static void onsignal(int);
static void pinger(void);
static char *pr_addr(struct in_addr);
static char *pr_ntime(n_time);
static void pr_icmph(struct icmp *, struct ip *, const u_char *const);
static void pr_iph(struct ip *, const u_char *);
static void pr_pack(char *, ssize_t, struct sockaddr_in *, struct timespec *);
-static void status(int);
-static void stopit(int);
int
ping(int argc, char *const *argv)
@@ -885,25 +872,21 @@
sigemptyset(&si_sa.sa_mask);
si_sa.sa_flags = 0;
- si_sa.sa_handler = stopit;
+ si_sa.sa_handler = onsignal;
if (sigaction(SIGINT, &si_sa, 0) == -1) {
err(EX_OSERR, "sigaction SIGINT");
}
-
- si_sa.sa_handler = stopit;
if (sigaction(SIGQUIT, &si_sa, 0) == -1)
err(EX_OSERR, "sigaction SIGQUIT");
-
- si_sa.sa_handler = status;
+#ifdef SIGINFO
if (sigaction(SIGINFO, &si_sa, 0) == -1) {
err(EX_OSERR, "sigaction SIGINFO");
}
-
- if (alarmtimeout > 0) {
- si_sa.sa_handler = stopit;
+#endif
+ if (alarmtimeout > 0) {
if (sigaction(SIGALRM, &si_sa, 0) == -1)
err(EX_OSERR, "sigaction SIGALRM");
- }
+ }
bzero(&msg, sizeof(msg));
msg.msg_name = (caddr_t)&from;
@@ -935,13 +918,22 @@
}
almost_done = 0;
- while (!finish_up) {
+ while (seenint == 0) {
struct timespec now, timeout;
fd_set rfds;
int n;
ssize_t cc;
- check_status();
+ /* signal handling */
+ if (seenint)
+ onint(SIGINT);
+#ifdef SIGINFO
+ if (seeninfo) {
+ pr_summary(stderr);
+ seeninfo = 0;
+ continue;
+ }
+#endif
if ((unsigned)srecv >= FD_SETSIZE)
errx(EX_OSERR, "descriptor too large");
FD_ZERO(&rfds);
@@ -1022,28 +1014,28 @@
}
}
}
- finish();
- /* NOTREACHED */
- exit(0); /* Make the compiler happy */
+ pr_summary(stdout);
+ exit(nreceived ? 0 : 2);
}
/*
- * stopit --
+ * onsignal --
* Set the global bit that causes the main loop to quit.
- * Do NOT call finish() from here, since finish() does far too much
- * to be called from a signal handler.
*/
-void
-stopit(int sig __unused)
+static void
+onsignal(int sig)
{
-
- /*
- * When doing reverse DNS lookups, the finish_up flag might not
- * be noticed for a while. Just exit if we get a second SIGINT.
- */
- if (!(options & F_NUMERIC) && finish_up)
- _exit(nreceived ? 0 : 2);
- finish_up = 1;
+ switch (sig) {
+ case SIGINT:
+ case SIGALRM:
+ seenint++;
+ break;
+#ifdef SIGINFO
+ case SIGINFO:
+ seeninfo++;
+ break;
+#endif
+ }
}
/*
@@ -1467,74 +1459,19 @@
}
/*
- * status --
- * Print out statistics when SIGINFO is received.
+ * onint --
+ * SIGINT handler.
*/
-
+/* ARGSUSED */
static void
-status(int sig __unused)
+onint(int notused __unused)
{
-
- siginfo_p = 1;
-}
-
-static void
-check_status(void)
-{
-
- if (siginfo_p) {
- siginfo_p = 0;
- (void)fprintf(stderr, "\r%ld/%ld packets received (%.1f%%)",
- nreceived, ntransmitted,
- ntransmitted ? nreceived * 100.0 / ntransmitted : 0.0);
- if (nreceived && timing)
- (void)fprintf(stderr, " %.3f min / %.3f avg / %.3f max",
- tmin, tsum / (nreceived + nrepeats), tmax);
- (void)fprintf(stderr, "\n");
- }
-}
-
-/*
- * finish --
- * Print out statistics, and give up.
- */
-static void
-finish(void)
-{
-
- (void)signal(SIGINT, SIG_IGN);
- (void)signal(SIGALRM, SIG_IGN);
- (void)putchar('\n');
- (void)fflush(stdout);
- (void)printf("--- %s ping statistics ---\n", hostname);
- (void)printf("%ld packets transmitted, ", ntransmitted);
- (void)printf("%ld packets received, ", nreceived);
- if (nrepeats)
- (void)printf("+%ld duplicates, ", nrepeats);
- if (ntransmitted) {
- if (nreceived > ntransmitted)
- (void)printf("-- somebody's printing up packets!");
- else
- (void)printf("%.1f%% packet loss",
- ((ntransmitted - nreceived) * 100.0) /
- ntransmitted);
- }
- if (nrcvtimeout)
- (void)printf(", %ld packets out of wait time", nrcvtimeout);
- (void)putchar('\n');
- if (nreceived && timing) {
- double n = nreceived + nrepeats;
- double avg = tsum / n;
- double vari = tsumsq / n - avg * avg;
- (void)printf(
- "round-trip min/avg/max/stddev = %.3f/%.3f/%.3f/%.3f ms\n",
- tmin, avg, tmax, sqrt(vari));
- }
-
- if (nreceived)
- exit(0);
- else
- exit(2);
+ /*
+ * When doing reverse DNS lookups, the seenint flag might not
+ * be noticed for a while. Just exit if we get a second SIGINT.
+ */
+ if (!(options & F_NUMERIC) && seenint != 0)
+ _exit(nreceived ? 0 : 2);
}
/*
diff --git a/sbin/ping/ping6.c b/sbin/ping/ping6.c
--- a/sbin/ping/ping6.c
+++ b/sbin/ping/ping6.c
@@ -126,7 +126,6 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <math.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -231,7 +230,6 @@
static const char *DOT = ".";
static size_t DOTlen = 1;
static size_t DOTidx = 0;
-static char *hostname;
static int ident; /* process id to identify our packets */
static u_int8_t nonce[8]; /* nonce field for node information */
static int hoplimit = -1; /* hoplimit */
@@ -243,20 +241,9 @@
/* counters */
static long nmissedmax; /* max value of ntransmitted - nreceived - 1 */
static long npackets; /* max packets to transmit */
-static long nreceived; /* # of packets we got back */
-static long nrepeats; /* number of duplicates */
-static long ntransmitted; /* sequence # for outbound packets = #sent */
static long ntransmitfailures; /* number of transmit failures */
static int interval = 1000; /* interval between packets in ms */
static int waittime = MAXWAIT; /* timeout for each packet */
-static long nrcvtimeout = 0; /* # of packets we got back after waittime */
-
-/* timing */
-static int timing; /* flag to do timing */
-static double tmin = 999999999.0; /* minimum round trip time */
-static double tmax = 0.0; /* maximum round trip time */
-static double tsum = 0.0; /* sum of all times, for doing average */
-static double tsumsq = 0.0; /* sum of all times squared, for std. dev. */
/* for node addresses */
static u_short naflags;
@@ -295,7 +282,6 @@
static void pr_rthdr(void *, size_t);
static int pr_bitrange(u_int32_t, int, int);
static void pr_retip(struct ip6_hdr *, u_char *);
-static void summary(void);
#ifdef IPSEC
#ifdef IPSEC_POLICY_IPSEC
static int setpolicy(int, char *);
@@ -1144,7 +1130,7 @@
if (caph_rights_limit(ssend, &rights_ssend) < 0)
err(1, "caph_rights_limit ssend setsockopt");
- printf("PING6(%lu=40+8+%lu bytes) ", (unsigned long)(40 + pingerlen()),
+ printf("PING(%lu=40+8+%lu bytes) ", (unsigned long)(40 + pingerlen()),
(unsigned long)(pingerlen() - 8));
printf("%s --> ", pr_addr((struct sockaddr *)&src, sizeof(src)));
printf("%s\n", pr_addr((struct sockaddr *)&dst, sizeof(dst)));
@@ -1192,7 +1178,7 @@
onint(SIGINT);
#ifdef SIGINFO
if (seeninfo) {
- summary();
+ pr_summary(stderr);
seeninfo = 0;
continue;
}
@@ -1290,7 +1276,7 @@
si_sa.sa_handler = SIG_IGN;
sigaction(SIGINT, &si_sa, 0);
sigaction(SIGALRM, &si_sa, 0);
- summary();
+ pr_summary(stdout);
if(packet != NULL)
free(packet);
@@ -1306,7 +1292,6 @@
static void
onsignal(int sig)
{
-
switch (sig) {
case SIGINT:
case SIGALRM:
@@ -1471,7 +1456,7 @@
ntransmitfailures++;
warn("sendmsg");
}
- (void)printf("ping6: wrote %s %d chars, ret=%d\n",
+ (void)printf("ping: wrote %s %d chars, ret=%d\n",
hostname, cc, i);
}
if (!(options & F_QUIET) && options & F_DOT)
@@ -2323,43 +2308,6 @@
_exit(nreceived ? 0 : 2);
}
-/*
- * summary --
- * Print out statistics.
- */
-static void
-summary(void)
-{
-
- (void)printf("\n--- %s ping6 statistics ---\n", hostname);
- (void)printf("%ld packets transmitted, ", ntransmitted);
- (void)printf("%ld packets received, ", nreceived);
- if (nrepeats)
- (void)printf("+%ld duplicates, ", nrepeats);
- if (ntransmitted) {
- if (nreceived > ntransmitted)
- (void)printf("-- somebody's duplicating packets!");
- else
- (void)printf("%.1f%% packet loss",
- ((((double)ntransmitted - nreceived) * 100.0) /
- ntransmitted));
- }
- if (nrcvtimeout)
- printf(", %ld packets out of wait time", nrcvtimeout);
- (void)putchar('\n');
- if (nreceived && timing) {
- /* Only display average to microseconds */
- double num = nreceived + nrepeats;
- double avg = tsum / num;
- double dev = sqrt(tsumsq / num - avg * avg);
- (void)printf(
- "round-trip min/avg/max/std-dev = %.3f/%.3f/%.3f/%.3f ms\n",
- tmin, avg, tmax, dev);
- (void)fflush(stdout);
- }
- (void)fflush(stdout);
-}
-
/*subject type*/
static const char *niqcode[] = {
"IPv6 address",
diff --git a/sbin/ping/tests/ping_6_c1_s8_t1.out b/sbin/ping/tests/ping_6_c1_s8_t1.out
--- a/sbin/ping/tests/ping_6_c1_s8_t1.out
+++ b/sbin/ping/tests/ping_6_c1_s8_t1.out
@@ -1,6 +1,6 @@
-PING6(56=40+8+8 bytes) ::1 --> ::1
+PING(56=40+8+8 bytes) ::1 --> ::1
16 bytes from ::1, icmp_seq=0 hlim= time= ms
---- localhost ping6 statistics ---
+--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
+round-trip min/avg/max/stddev = /// ms
diff --git a/sbin/ping/tests/ping_c1_s8_t1_S1.out b/sbin/ping/tests/ping_c1_s8_t1_S1.out
--- a/sbin/ping/tests/ping_c1_s8_t1_S1.out
+++ b/sbin/ping/tests/ping_c1_s8_t1_S1.out
@@ -1,6 +1,6 @@
-PING6(56=40+8+8 bytes) ::1 --> ::1
+PING(56=40+8+8 bytes) ::1 --> ::1
16 bytes from ::1, icmp_seq=0 hlim= time= ms
---- localhost ping6 statistics ---
+--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
+round-trip min/avg/max/stddev = /// ms
diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py
--- a/sbin/ping/tests/test_ping.py
+++ b/sbin/ping/tests/test_ping.py
@@ -304,12 +304,12 @@
"args": "ping -6 -c1 -s8 -t1 localhost",
"returncode": 0,
"stdout": """\
-PING6(56=40+8+8 bytes) ::1 --> ::1
+PING(56=40+8+8 bytes) ::1 --> ::1
16 bytes from ::1, icmp_seq=0 hlim= time= ms
---- localhost ping6 statistics ---
+--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
+round-trip min/avg/max/stddev = /// ms
""",
"stderr": "",
},
@@ -350,12 +350,12 @@
"args": "ping -A -c1 2001:db8::1",
"returncode": 0,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms
---- 2001:db8::1 ping6 statistics ---
+--- 2001:db8::1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
+round-trip min/avg/max/stddev = /// ms
""",
"stderr": "",
},
@@ -366,9 +366,9 @@
"args": "ping -A -c1 2001:db8::2",
"returncode": 2,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
---- 2001:db8::2 ping6 statistics ---
+--- 2001:db8::2 ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
""",
"stderr": "",
@@ -412,14 +412,14 @@
"args": "ping -A -c3 2001:db8::1",
"returncode": 0,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms
16 bytes from 2001:db8::1, icmp_seq=1 hlim= time= ms
16 bytes from 2001:db8::1, icmp_seq=2 hlim= time= ms
---- 2001:db8::1 ping6 statistics ---
+--- 2001:db8::1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
+round-trip min/avg/max/stddev = /// ms
""",
"stderr": "",
},
@@ -430,9 +430,9 @@
"args": "ping -A -c3 2001:db8::2",
"returncode": 2,
"stdout": """\
-\x07\x07PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
+\x07\x07PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
---- 2001:db8::2 ping6 statistics ---
+--- 2001:db8::2 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
""",
"stderr": "",
@@ -474,12 +474,12 @@
"args": "ping -c1 2001:db8::1",
"returncode": 0,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms
---- 2001:db8::1 ping6 statistics ---
+--- 2001:db8::1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
+round-trip min/avg/max/stddev = /// ms
""",
"stderr": "",
},
@@ -490,9 +490,9 @@
"args": "ping -c1 2001:db8::2",
"returncode": 2,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
---- 2001:db8::2 ping6 statistics ---
+--- 2001:db8::2 ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
""",
"stderr": "",
@@ -520,12 +520,12 @@
"args": "ping -c1 -S::1 -s8 -t1 localhost",
"returncode": 0,
"stdout": """\
-PING6(56=40+8+8 bytes) ::1 --> ::1
+PING(56=40+8+8 bytes) ::1 --> ::1
16 bytes from ::1, icmp_seq=0 hlim= time= ms
---- localhost ping6 statistics ---
+--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
+round-trip min/avg/max/stddev = /// ms
""",
"stderr": "",
},
@@ -568,14 +568,14 @@
"args": "ping -c3 2001:db8::1",
"returncode": 0,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
16 bytes from 2001:db8::1, icmp_seq=0 hlim= time= ms
16 bytes from 2001:db8::1, icmp_seq=1 hlim= time= ms
16 bytes from 2001:db8::1, icmp_seq=2 hlim= time= ms
---- 2001:db8::1 ping6 statistics ---
+--- 2001:db8::1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
+round-trip min/avg/max/stddev = /// ms
""",
"stderr": "",
},
@@ -586,9 +586,9 @@
"args": "ping -c3 2001:db8::2",
"returncode": 2,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
---- 2001:db8::2 ping6 statistics ---
+--- 2001:db8::2 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
""",
"stderr": "",
@@ -629,11 +629,11 @@
"args": "ping -q -c1 2001:db8::1",
"returncode": 0,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
---- 2001:db8::1 ping6 statistics ---
+--- 2001:db8::1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
+round-trip min/avg/max/stddev = /// ms
""",
"stderr": "",
},
@@ -644,9 +644,9 @@
"args": "ping -q -c1 2001:db8::2",
"returncode": 2,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
---- 2001:db8::2 ping6 statistics ---
+--- 2001:db8::2 ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
""",
"stderr": "",
@@ -687,11 +687,11 @@
"args": "ping -q -c3 2001:db8::1",
"returncode": 0,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::1
---- 2001:db8::1 ping6 statistics ---
+--- 2001:db8::1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
+round-trip min/avg/max/stddev = /// ms
""",
"stderr": "",
},
@@ -702,9 +702,9 @@
"args": "ping -q -c3 2001:db8::2",
"returncode": 2,
"stdout": """\
-PING6(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
+PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2
---- 2001:db8::2 ping6 statistics ---
+--- 2001:db8::2 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
""",
"stderr": "",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 6, 7:33 PM (13 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33784232
Default Alt Text
D39126.id118935.diff (21 KB)
Attached To
Mode
D39126: ping: Unify ping/ping6 statistics section
Attached
Detach File
Event Timeline
Log In to Comment