-.\" $OpenBSD: ping6.8,v 1.49 2015/08/31 12:00:21 florian Exp $
+.\" $OpenBSD: ping6.8,v 1.50 2015/10/12 18:32:18 deraadt Exp $
.\" $KAME: ping6.8,v 1.57 2002/05/26 13:18:25 itojun Exp $
.\"
.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 31 2015 $
+.Dd $Mdocdate: October 12 2015 $
.Dt PING6 8
.Os
.Sh NAME
.Nd send ICMPv6 ECHO_REQUEST packets to network hosts
.Sh SYNOPSIS
.Nm ping6
-.Op Fl dEefHmNnqtvWw
+.Op Fl dEefHmNnqtvw
.Op Fl a Ar addrtype
.Op Fl b Ar bufsiz
.Op Fl c Ar count
Verbose output.
All ICMP packets
that are received are listed.
-.It Fl W
-The
-same as
-.Fl w ,
-but with the old packet format based on the 03 draft.
-This option is present for backward compatibility.
-.Fl s
-has no effect if
-this option
-is specified.
.It Fl w
Generate an ICMPv6 Node Information DNS Name query,
rather than echo-request.
-/* $OpenBSD: ping6.c,v 1.120 2015/10/09 01:37:06 deraadt Exp $ */
+/* $OpenBSD: ping6.c,v 1.121 2015/10/12 18:32:18 deraadt Exp $ */
/* $KAME: ping6.c,v 1.163 2002/10/25 02:19:06 itojun Exp $ */
/*
#define F_INTERFACE 0x2000
#define F_SRCADDR 0x4000
#define F_HOSTNAME 0x10000
-#define F_FQDNOLD 0x20000
#define F_NIGROUP 0x40000
#define F_SUPTYPES 0x80000
#define F_AUD_RECV 0x200000
#define F_AUD_MISS 0x400000
-#define F_NOUSERDATA (F_NODEADDR | F_FQDN | F_FQDNOLD | F_SUPTYPES)
+#define F_NOUSERDATA (F_NODEADDR | F_FQDN | F_SUPTYPES)
u_int options;
#define DUMMY_PORT 10101
preload = 0;
datap = &outpack[ICMP6ECHOLEN + ICMP6ECHOTMLEN];
while ((ch = getopt(argc, argv,
- "a:b:c:dEefHg:h:I:i:l:mnNp:qS:s:tvV:wW")) != -1) {
+ "a:b:c:dEefHg:h:I:i:l:mnNp:qS:s:tvV:w")) != -1) {
switch (ch) {
case 'a':
{
options &= ~F_NOUSERDATA;
options |= F_FQDN;
break;
- case 'W':
- options &= ~F_NOUSERDATA;
- options |= F_FQDNOLD;
- break;
default:
usage();
/*NOTREACHED*/
struct icmp6_filter filt;
if (!(options & F_VERBOSE)) {
ICMP6_FILTER_SETBLOCKALL(&filt);
- if ((options & F_FQDN) || (options & F_FQDNOLD) ||
- (options & F_NODEADDR) || (options & F_SUPTYPES))
+ if ((options & F_FQDN) || (options & F_NODEADDR) ||
+ (options & F_SUPTYPES))
ICMP6_FILTER_SETPASS(ICMP6_NI_REPLY, &filt);
else
ICMP6_FILTER_SETPASS(ICMP6_ECHO_REPLY, &filt);
if (options & F_FQDN)
l = ICMP6_NIQLEN + sizeof(dst.sin6_addr);
- else if (options & F_FQDNOLD)
- l = ICMP6_NIQLEN;
else if (options & F_NODEADDR)
l = ICMP6_NIQLEN + sizeof(dst.sin6_addr);
else if (options & F_SUPTYPES)
sizeof(dst.sin6_addr));
cc = ICMP6_NIQLEN + sizeof(dst.sin6_addr);
datalen = 0;
- } else if (options & F_FQDNOLD) {
- /* packet format in 03 draft - no Subject data on queries */
- icp->icmp6_type = ICMP6_NI_QUERY;
- icp->icmp6_code = 0; /* code field is always 0 */
- nip->ni_qtype = htons(NI_QTYPE_FQDN);
- nip->ni_flags = htons(0);
-
- memcpy(nip->icmp6_ni_nonce, nonce,
- sizeof(nip->icmp6_ni_nonce));
- *(u_int16_t *)nip->icmp6_ni_nonce = ntohs(seq);
-
- cc = ICMP6_NIQLEN;
- datalen = 0;
} else if (options & F_NODEADDR) {
icp->icmp6_type = ICMP6_NI_QUERY;
icp->icmp6_code = ICMP6_NI_SUBJ_IPV6;
(void)fprintf(stderr,
"usage: ping6 [-dEefH"
"m"
- "NnqtvWw"
+ "Nnqtvw"
"] [-a addrtype] [-b bufsiz] [-c count] [-g gateway]\n\t"
"[-h hoplimit] [-I interface] [-i wait] [-l preload] [-p pattern]"
"\n\t[-S sourceaddr] [-s packetsize] [-V rtable] host\n");