From nobody Fri Jan 27 19:28:09 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P3SKP40wVz3brw0; Fri, 27 Jan 2023 19:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P3SKP3D64z45qD; Fri, 27 Jan 2023 19:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674847689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UGYnHT92KiWK4XZ/UJf+7uzVv7iPBZpw0Yg+dHWWFy8=; b=N5+BkgOw2BiRylogUdZUNyL0rpQH5QWSW77Unp13yu98IjYJ/xMIBkIBi2hKndIRCiUT83 cTj57z3U1n7JIPYe/48j1BMAwctzuLIjS9hKTh8oo8w2UtkJ+oR6yiBjnzAP7CjOs1L8nM KOKe9tlHdeOf6xLeN0GRVVEfWhsWd8l6sQZqMdmCuTPE0Jxo0XLanh984FQqvT0FNqUCH/ +dD69XxsDZNBi+bLay9sZ9IFJGzL2sdsQjre4lMmt1rd86zTqfM2IH5Qw8AywOEcn9t7Zz ZfIJ4EjtvTOEBgT82C7q6JOuWr/ZoSYdWZjM7SkgZwCmwbd5PZ/Pgpb0pTcRDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674847689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UGYnHT92KiWK4XZ/UJf+7uzVv7iPBZpw0Yg+dHWWFy8=; b=D0ryl0p8rYwst4k3P1fQsWokMioISWbnpWNG/SFPKhGT7b0zvtuChF51BfA2X1M4oEOS6T zypiFfpKqUQWj5Df8dyVrMje7Y+DIZAXt+tB4EPyMo1Vd7GwI7UFgXRIEpaQyDNDCUE3sR ihex99eqHVaK1/kM0hQWMsX/ie3VzMCXxVGtLekzvL3DhGvnpB5HD6CHOm3MFZaYbRt63Q 4VlBvz80b8egEqL8QspZp2f8nGkzYRr/09731uKjtBN3a33g9axdioW2ZA5e0gGU2+UCOa KmhvQXxHown8USdHMMwGxNPirRrgrREBzPWPOuzGnIrUxzqJaFcM5VR+goDk7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674847689; a=rsa-sha256; cv=none; b=rEW4BjepfAFXEVpj+TbxxMMOc5CBRFrz+VXa48Mg3KsP58neqvx1h347BTPz5ujCDRMVbf aiuNh5AJI7Hx9Trt9F0DL3+SANR0ce3sYQRoqHCy+TXu8muo0xw5XAyWotMe6SbISTpn8/ dL5uz9hSJ7rh2hIWKzBsR/ugEqSdhu0LpatCaLZlLvhXiF7/WcpBSwVnB+MHtGW/Dk328w kN4EqvRx5YnEAnDwTD6cVjjYNlpfKjYPacatEJA2hD+Eo3h0nkvdnR1YVC5HWOlSx1TScL 6rk+Ja9LYe5lwL8KHwrMy07yy3ik62YGHexiDalM6nzMvyYrPApe2fSMZVhSow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P3SKP27lSzLGy; Fri, 27 Jan 2023 19:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30RJS9Tl029160; Fri, 27 Jan 2023 19:28:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30RJS9Wj029159; Fri, 27 Jan 2023 19:28:09 GMT (envelope-from git) Date: Fri, 27 Jan 2023 19:28:09 GMT Message-Id: <202301271928.30RJS9Wj029159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 8a8d695deea0 - stable/13 - ping(8): man page cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a8d695deea0cb330c0e76a84e4861a26357e274 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=8a8d695deea0cb330c0e76a84e4861a26357e274 commit 8a8d695deea0cb330c0e76a84e4861a26357e274 Author: Jose Luis Duran AuthorDate: 2022-11-20 02:56:49 +0000 Commit: Alan Somers CommitDate: 2023-01-27 19:27:47 +0000 ping(8): man page cleanup * Appease mandoc -T lint and igor * Use example.com for documentation * Update the IPv4 TTL section. Update the IPv4 TTL section specifically for FreeBSD. FreeBSD changed the default TTL to 64 in 5639e86bdd7ea151958776264bf5a67e60a54d68. NetBSD and OpenBSD still use 255. Remove some references of extinct operating systems. Reviewed by: gbe (manpages), asomers Pull Request: https://github.com/freebsd/freebsd-src/pull/630 (cherry picked from commit 8eb4df948711166a438f4111f7069a412d1456bd) --- sbin/ping/ping.8 | 144 +++++++++++++++++++++++++++---------------------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/sbin/ping/ping.8 b/sbin/ping/ping.8 index fceff650fbc1..689641a09282 100644 --- a/sbin/ping/ping.8 +++ b/sbin/ping/ping.8 @@ -28,15 +28,15 @@ .\" @(#)ping.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd November 26, 2020 +.Dd November 20, 2022 .Dt PING 8 .Os .Sh NAME .Nm ping .Nd send -.Tn ICMP +ICMP or -.Tn ICMPv6 ECHO_REQUEST +ICMPv6 ECHO_REQUEST packets to network hosts .Sh SYNOPSIS .Nm @@ -101,19 +101,21 @@ packets to network hosts The .Nm utility invoked with an IPv4 target -.Ns ( Ar IPv4-host No or Ar IPv4-mcast-group Ns ) +.Ar ( IPv4-host +or +.Ar IPv4-mcast-group ) uses the -.Tn ICMP +ICMP .No protocol Ap s mandatory -.Tn ECHO_REQUEST +ECHO_REQUEST datagram to elicit an -.Tn ICMP ECHO_RESPONSE +ICMP ECHO_RESPONSE from a host or gateway. -.Tn ECHO_REQUEST +ECHO_REQUEST datagrams .Pq Dq pings have an IP and -.Tn ICMP +ICMP header, followed by a .Dq struct timeval and then an arbitrary number of @@ -121,24 +123,26 @@ and then an arbitrary number of bytes used to fill out the packet. .Pp When invoked with an IPv6 target -.Ns ( Ar IPv6-host Ns ) Ns , +.Ar ( IPv6-host ) , it uses the -.Tn ICMPv6 +ICMPv6 protocol's mandatory -.Tn ICMP6_ECHO_REQUEST +ICMP6_ECHO_REQUEST datagram to elicit an -.Tn ICMP6_ECHO_REPLY -.Ns . -.Tn ICMP6_ECHO_REQUEST +ICMP6_ECHO_REPLY. +ICMP6_ECHO_REQUEST datagrams have an IPv6 header and -.Tn ICMPv6 +ICMPv6 header formatted as documented in RFC 2463. .Pp -When invoked with a hostname, the version to which the target is resolved first is used. -In that case, the options and arguments used must be valid for the specific IP version, otherwise +When invoked with a hostname, the version to which the target is resolved first +is used. +In that case, the options and arguments used must be valid for the specific IP +version, otherwise .Nm exits with an error. -If the target is resolved to both IPv4 and IPv6, the specific IP version can be requested by +If the target is resolved to both IPv4 and IPv6, the specific IP version can be +requested by .Fl 4 or .Fl 6 @@ -150,11 +154,11 @@ as .Bl -tag -width indent .It Fl .\& Ns Ar chars By default, for every -.Tn ECHO_REQUEST +ECHO_REQUEST sent, a period .Dq .\& is printed, while for every -.Tn ECHO_REPLY +ECHO_REPLY received, a backspace is printed. This option takes an optional string argument listing characters that will be printed one by one in the provided order @@ -167,7 +171,7 @@ ping -.0123456789 freebsd.org .It Fl A Audible. Output a bell -.Tn ( ASCII +(ASCII 0x07) character when no packet is received before the next packet is transmitted. @@ -177,7 +181,7 @@ if the maximum number of unreceived packets has increased. .It Fl a Audible. Include a bell -.Tn ( ASCII +(ASCII 0x07) character in the output when any packet is received. .It Fl C Ar pcp @@ -187,7 +191,7 @@ Add an 802.1p Ethernet Priority Code Point when sending a packet. Stop after sending (and receiving) .Ar count -.Tn ECHO_RESPONSE +ECHO_RESPONSE packets. If this option is not specified, .Nm @@ -210,9 +214,9 @@ whichever is more. Implies .Fl .\& to print a period for every -.Tn ECHO_REQUEST +ECHO_REQUEST sent and a backspace for every -.Tn ECHO_REPLY +ECHO_REPLY received. This provides a rapid display of how many packets are being dropped. Only the super-user may use this option. @@ -233,9 +237,9 @@ This flag applies only if the ping target is a multicast address. .Pp For an IPv6 target, .Ar iface -is a name of an interface (e.g. `em0') from which the packets will be sent. -This flag applies if the ping target is a multicast address, or link-local/site-local -unicast address. +is a name of an interface (e.g., `em0') from which the packets will be sent. +This flag applies if the ping target is a multicast address, or +link-local/site-local unicast address. .It Fl i Ar wait Wait .Ar wait @@ -304,10 +308,10 @@ the sending node, and must be numeric. .It Fl s Ar packetsize Specify the number of data bytes to be sent. The default is 56, which translates into 64 -.Tn ICMP +ICMP data bytes when combined with the 8 bytes of -.Tn ICMP +ICMP header data. .Pp For IPv4, only the super-user may specify values more than default. @@ -321,9 +325,9 @@ Specify a timeout, in seconds, before ping exits regardless of how many packets have been received. .It Fl v Verbose output. -.Tn ICMP +ICMP packets other than -.Tn ECHO_RESPONSE +ECHO_RESPONSE that are received are listed. .It Fl W Ar waittime Time in milliseconds to wait for a reply for each packet sent. @@ -336,17 +340,17 @@ considered as replied when calculating statistics. Use IPv4 regardless of how the target is resolved. .It Fl G Ar sweepmaxsize Specify the maximum size of -.Tn ICMP +ICMP payload when sending sweeping pings. This option is required for ping sweeps. .It Fl g Ar sweepminsize Specify the size of -.Tn ICMP +ICMP payload to start with when sending sweeping pings. The default value is 0. .It Fl h Ar sweepincrsize Specify the number of bytes to increment the size of -.Tn ICMP +ICMP payload after each sweep when sending sweeping pings. The default value is 1. @@ -396,9 +400,9 @@ messages. .It Fl R Record route. Includes the -.Tn RECORD_ROUTE +RECORD_ROUTE option in the -.Tn ECHO_REQUEST +ECHO_REQUEST packet and displays the route buffer on returned packets. Note that the IP header is only large enough for nine such routes; @@ -410,7 +414,7 @@ If more routes come back than should, such as due to an illegal spoofed packet, ping will print the route list and then truncate it at the correct spot. Many hosts ignore or discard the -.Tn RECORD_ROUTE +RECORD_ROUTE option. .It Fl r Bypass the normal routing tables and send directly to a host on an attached @@ -575,21 +579,21 @@ during normal operations or from automated scripts. .Sh ICMP PACKET DETAILS An IP header without options is 20 bytes. An -.Tn ICMP -.Tn ECHO_REQUEST +ICMP +ECHO_REQUEST packet contains an additional 8 bytes worth of -.Tn ICMP +ICMP header followed by an arbitrary amount of data. When a .Ar packetsize is given, this indicated the size of this extra piece of data (the default is 56). Thus the amount of data received inside of an IP packet of type -.Tn ICMP -.Tn ECHO_REPLY +ICMP +ECHO_REPLY will always be 8 bytes more than the requested data space (the -.Tn ICMP +ICMP header). .Pp If the data space is at least eight bytes large, @@ -648,33 +652,29 @@ option of .Nm . .Sh IPv4 TTL DETAILS The -.Tn TTL +TTL value of an IP packet represents the maximum number of IP routers that the packet can go through before being thrown away. In current practice you can expect each router in the Internet to decrement the -.Tn TTL +TTL field by exactly one. .Pp The -.Tn TCP/IP +TCP/IP specification recommends setting the -.Tn TTL +TTL field for -.Tn IP -packets to 64, but many systems use smaller values -.No ( Bx 4.3 -uses 30, -.Bx 4.2 -used 15). +IP +packets to 64. .Pp -The maximum possible value of this field is 255, and most +The maximum possible value of this field is 255, and some .Ux systems set the -.Tn TTL +TTL field of -.Tn ICMP ECHO_REQUEST +ICMP ECHO_REQUEST packets to 255. This is why you will find you can .Dq ping @@ -688,7 +688,7 @@ In normal operation prints the ttl value from the packet it receives. When a remote system receives a ping packet, it can do one of three things with the -.Tn TTL +TTL field in its response: .Bl -bullet .It @@ -698,16 +698,16 @@ systems did before the .Bx 4.3 tahoe release. In this case the -.Tn TTL +TTL value in the received packet will be 255 minus the number of routers in the round-trip path. .It -Set it to 255; this is what current -.Bx +Set it to 64; this is what current +.Fx systems do. In this case the -.Tn TTL -value in the received packet will be 255 minus the +TTL +value in the received packet will be 64 minus the number of routers in the path .Em from the remote system @@ -718,9 +718,9 @@ host. .It Set it to some other value. Some machines use the same value for -.Tn ICMP +ICMP packets that they use for -.Tn TCP +TCP packets, for example either 30 or 60. Others may use completely wild values. .El @@ -739,9 +739,9 @@ An error occurred. .El .Sh EXAMPLES The following will send ICMPv6 echo request to -.Li dst.foo.com . +.Li dst.example.com . .Bd -literal -offset indent -ping -6 -n dst.foo.com +ping -6 -n dst.example.com .Ed .Pp The following will probe hostnames for all nodes on the network link attached to @@ -756,9 +756,9 @@ ping -6 -y ff02::1%wi0 .Ed .Pp The following will probe addresses assigned to the destination node, -.Li dst.foo.com . +.Li dst.example.com . .Bd -literal -offset indent -ping -6 -k agl dst.foo.com +ping -6 -k agl dst.example.com .Ed .Sh SEE ALSO .Xr netstat 1 , @@ -813,11 +813,11 @@ while at the US Army Ballistics Research Laboratory. .Sh BUGS Many Hosts and Gateways ignore the IPv4 -.Tn RECORD_ROUTE +RECORD_ROUTE option. .Pp The maximum IP header length is too small for options like -.Tn RECORD_ROUTE +RECORD_ROUTE to be completely useful. .No There Ap s not much that can be done about this, however.