Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145164110
D21345.id61135.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
9 KB
Referenced Files
None
Subscribers
None
D21345.id61135.diff
View Options
Index: sbin/ping6/ping6.8
===================================================================
--- sbin/ping6/ping6.8
+++ sbin/ping6/ping6.8
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 22, 2014
+.Dd August 22, 2019
.Dt PING6 8
.Os
.Sh NAME
@@ -40,23 +40,17 @@
.Sh SYNOPSIS
.Nm
.\" without ipsec, or new ipsec
-.Op Fl DdfHmnNoqrRtvwW
+.Op Fl aAdDfHnNoOquvyY
.\" old ipsec
.\" .Op Fl ADdEfmnNqRtvwW
.Bk -words
-.Op Fl a Ar addrtype
-.Ek
-.Bk -words
.Op Fl b Ar bufsiz
.Ek
.Bk -words
.Op Fl c Ar count
.Ek
.Bk -words
-.Op Fl g Ar gateway
-.Ek
-.Bk -words
-.Op Fl h Ar hoplimit
+.Op Fl e Ar gateway
.Ek
.Bk -words
.Op Fl I Ar interface
@@ -65,13 +59,13 @@
.Op Fl i Ar wait
.Ek
.Bk -words
-.Op Fl x Ar waittime
+.Op Fl k Ar addrtype
.Ek
.Bk -words
-.Op Fl X Ar timeout
+.Op Fl l Ar preload
.Ek
.Bk -words
-.Op Fl l Ar preload
+.Op Fl m Ar hoplimit
.Ek
.Bk -words
.\" new ipsec
@@ -87,6 +81,12 @@
.Op Fl s Ar packetsize
.Ek
.Bk -words
+.Op Fl t Ar timeout
+.Ek
+.Bk -words
+.Op Fl W Ar waittime
+.Ek
+.Bk -words
.Op Ar hops ...
.Ek
.Bk -words
@@ -110,10 +110,10 @@
The options are as follows:
.Bl -tag -width Ds
.\" old ipsec
-.\" .It Fl A
+.\" .It Fl Z
.\" Enables transport-mode IPsec authentication header
.\" (experimental).
-.It Fl a Ar addrtype
+.It Fl k Ar addrtype
Generate ICMPv6 Node Information Node Addresses query, rather than echo-request.
.Ar addrtype
must be a string constructed of the following characters.
@@ -172,7 +172,7 @@
.Bf -emphasis
This can be very hard on a network and should be used with caution.
.Ef
-.It Fl g Ar gateway
+.It Fl e Ar gateway
Specifies to use
.Ar gateway
as the next hop to the destination.
@@ -182,7 +182,7 @@
The
.Nm
utility does not try reverse-lookup unless the option is specified.
-.It Fl h Ar hoplimit
+.It Fl m Ar hoplimit
Set the IPv6 hoplimit.
.It Fl I Ar interface
Source packets with the given interface address.
@@ -197,12 +197,12 @@
This option is incompatible with the
.Fl f
option.
-.It Fl x Ar waittime
+.It Fl W Ar waittime
Time in milliseconds to wait for a reply for each packet sent.
If a reply arrives later,
the packet is not printed as replied,
but considered as replied when calculating statistics.
-.It Fl X Ar timeout
+.It Fl t Ar timeout
Specify a timeout,
in seconds,
before ping exits regardless of how many packets have been received.
@@ -214,12 +214,12 @@
sends that many packets as fast as possible before falling into its normal
mode of behavior.
Only the super-user may use this option.
-.It Fl m
+.It Fl u
By default,
.Nm
asks the kernel to fragment packets to fit into the minimum IPv6 MTU.
The
-.Fl m
+.Fl u
option
will suppress the behavior in the following two levels:
when the option is specified once, the behavior will be disabled for
@@ -270,13 +270,13 @@
Quiet output.
Nothing is displayed except the summary lines at startup time and
when finished.
-.It Fl r
+.It Fl a
Audible.
Include a bell
.Tn ( ASCII
0x07)
character in the output when any packet is received.
-.It Fl R
+.It Fl A
Audible.
Output a bell
.Tn ( ASCII
@@ -301,12 +301,12 @@
You may need to specify
.Fl b
as well to extend socket buffer size.
-.It Fl t
+.It Fl O
Generate ICMPv6 Node Information supported query types query,
rather than echo-request.
.Fl s
has no effect if
-.Fl t
+.Fl O
is specified.
.It Fl v
Verbose output.
@@ -314,20 +314,20 @@
packets other than
.Tn ECHO_RESPONSE
that are received are listed.
-.It Fl w
+.It Fl y
Generate ICMPv6 Node Information DNS Name query, rather than echo-request.
.Fl s
has no effect if
-.Fl w
+.Fl y
is specified.
-.It Fl W
+.It Fl Y
Same as
-.Fl w ,
+.Fl y ,
but with old packet format based on 03 draft.
This option is present for backward compatibility.
.Fl s
has no effect if
-.Fl w
+.Fl y
is specified.
.It Ar hops
IPv6 addresses for intermediate nodes,
Index: sbin/ping6/ping6.c
===================================================================
--- sbin/ping6/ping6.c
+++ sbin/ping6/ping6.c
@@ -347,14 +347,14 @@
#ifdef IPSEC_POLICY_IPSEC
#define ADDOPTS "P:"
#else
-#define ADDOPTS "AE"
+#define ADDOPTS "ZE"
#endif /*IPSEC_POLICY_IPSEC*/
#endif
while ((ch = getopt(argc, argv,
- "a:b:c:DdfHg:h:I:i:l:mnNop:qrRS:s:tvwWx:X:" ADDOPTS)) != -1) {
+ "k:b:c:DdfHe:m:I:i:l:unNop:qaAS:s:OvyYW:t:" ADDOPTS)) != -1) {
#undef ADDOPTS
switch (ch) {
- case 'a':
+ case 'k':
{
char *cp;
@@ -431,13 +431,13 @@
options |= F_FLOOD;
setbuf(stdout, (char *)NULL);
break;
- case 'g':
+ case 'e':
gateway = optarg;
break;
case 'H':
options |= F_HOSTNAME;
break;
- case 'h': /* hoplimit */
+ case 'm': /* hoplimit */
hoplimit = strtol(optarg, &e, 10);
if (*optarg == '\0' || *e != '\0')
errx(1, "illegal hoplimit %s", optarg);
@@ -481,7 +481,7 @@
if (preload < 0 || *optarg == '\0' || *e != '\0')
errx(1, "illegal preload value -- %s", optarg);
break;
- case 'm':
+ case 'u':
#ifdef IPV6_USE_MIN_MTU
mflag++;
break;
@@ -506,10 +506,10 @@
case 'q':
options |= F_QUIET;
break;
- case 'r':
+ case 'a':
options |= F_AUDIBLE;
break;
- case 'R':
+ case 'A':
options |= F_MISSED;
break;
case 'S':
@@ -543,22 +543,22 @@
MAXDATALEN);
}
break;
- case 't':
+ case 'O':
options &= ~F_NOUSERDATA;
options |= F_SUPTYPES;
break;
case 'v':
options |= F_VERBOSE;
break;
- case 'w':
+ case 'y':
options &= ~F_NOUSERDATA;
options |= F_FQDN;
break;
- case 'W':
+ case 'Y':
options &= ~F_NOUSERDATA;
options |= F_FQDNOLD;
break;
- case 'x':
+ case 'W':
t = strtod(optarg, &e);
if (*e || e == optarg || t > (double)INT_MAX)
err(EX_USAGE, "invalid timing interval: `%s'",
@@ -566,7 +566,7 @@
options |= F_WAITTIME;
waittime = (int)t;
break;
- case 'X':
+ case 't':
alarmtimeout = strtoul(optarg, &e, 0);
if ((alarmtimeout < 1) || (alarmtimeout == ULONG_MAX))
errx(EX_USAGE, "invalid timeout: `%s'",
@@ -590,7 +590,7 @@
errx(1, "invalid security policy");
break;
#else
- case 'A':
+ case 'Z':
options |= F_AUTHHDR;
break;
case 'E':
@@ -1835,7 +1835,7 @@
bufsize = CONTROLLEN - ((caddr_t)CMSG_DATA(cm) - (caddr_t)bufp);
if (bufsize <= 0)
- continue;
+ continue;
switch (cm->cmsg_type) {
case IPV6_HOPOPTS:
printf(" HbH Options: ");
@@ -2783,7 +2783,7 @@
}
if (valid != 1)
return NULL; /*XXX*/
-
+
if (nig_oldmcprefix) {
/* draft-ietf-ipngwg-icmp-name-lookup */
bcopy(digest, &in6.s6_addr[12], 4);
@@ -2803,27 +2803,27 @@
{
(void)fprintf(stderr,
#if defined(IPSEC) && !defined(IPSEC_POLICY_IPSEC)
- "A"
+ "Z"
#endif
"usage: ping6 [-"
- "Dd"
+ "aADd"
#if defined(IPSEC) && !defined(IPSEC_POLICY_IPSEC)
"E"
#endif
- "fH"
+ "fHnNoOq"
#ifdef IPV6_USE_MIN_MTU
- "m"
+ "u"
#endif
- "nNoqrRtvwW] "
- "[-a addrtype] [-b bufsiz] [-c count] [-g gateway]\n"
- " [-h hoplimit] [-I interface] [-i wait] [-l preload]"
+ "vyY] "
+ "[-b bufsiz] [-c count] [-e gateway]\n"
+ " [-I interface] [-i wait] [-k addrtype] [-l preload] "
+ "[-m hoplimit]\n"
+ " [-p pattern]"
#if defined(IPSEC) && defined(IPSEC_POLICY_IPSEC)
" [-P policy]"
#endif
- "\n"
- " [-p pattern] [-S sourceaddr] [-s packetsize] "
- "[-x waittime]\n"
- " [-X timeout] [hops ...] host\n");
+ " [-S sourceaddr] [-s packetsize]\n"
+ " [-t timeout] [-W waittime] [hops ...] host\n");
exit(1);
}
Index: sbin/ping6/tests/Makefile
===================================================================
--- sbin/ping6/tests/Makefile
+++ sbin/ping6/tests/Makefile
@@ -3,6 +3,6 @@
PACKAGE= tests
ATF_TESTS_SH+= ping6_test
-${PACKAGE}FILES+= ping6_c1_s8_X1.out
+${PACKAGE}FILES+= ping6_c1_s8_t1.out
.include <bsd.test.mk>
Index: sbin/ping6/tests/ping6_c1_s8_X1.out
===================================================================
--- /dev/null
+++ sbin/ping6/tests/ping6_c1_s8_X1.out
@@ -1,6 +0,0 @@
-PING6(56=40+8+8 bytes) ::1 --> ::1
-16 bytes from ::1, icmp_seq=0 hlim= time= ms
-
---- localhost ping6 statistics ---
-1 packets transmitted, 1 packets received, 0.0% packet loss
-round-trip min/avg/max/std-dev = /// ms
Index: sbin/ping6/tests/ping6_test.sh
===================================================================
--- sbin/ping6/tests/ping6_test.sh
+++ sbin/ping6/tests/ping6_test.sh
@@ -27,21 +27,21 @@
#
# $FreeBSD$
-atf_test_case ping6_c1_s8_X1
-ping6_c1_s8_X1_head() {
+atf_test_case ping6_c1_s8_t1
+ping6_c1_s8_t1_head() {
atf_set "descr" "Stop after receiving 1 ECHO_RESPONSE packet"
}
-ping6_c1_s8_X1_body() {
+ping6_c1_s8_t1_body() {
if ! getaddrinfo -f inet6 localhost 1>/dev/null 2>&1; then
atf_skip "IPv6 is not configured"
fi
atf_check -s exit:0 -o save:std.out -e empty \
- ping6 -c 1 -s 8 -X 1 localhost
- check_ping_statistics std.out $(atf_get_srcdir)/ping6_c1_s8_X1.out
+ ping6 -c 1 -s 8 -t 1 localhost
+ check_ping_statistics std.out $(atf_get_srcdir)/ping6_c1_s8_t1.out
}
atf_init_test_cases() {
- atf_add_test_case ping6_c1_s8_X1
+ atf_add_test_case ping6_c1_s8_t1
}
check_ping_statistics() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 17, 3:36 PM (17 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28818100
Default Alt Text
D21345.id61135.diff (9 KB)
Attached To
Mode
D21345: ping6: Rename options for unifying option parsing with ping
Attached
Detach File
Event Timeline
Log In to Comment