Module Name:    src
Committed By:   dholland
Date:           Mon Jun  7 22:13:34 UTC 2021

Modified Files:
        src/sbin/ping6: ping6.8 ping6.c

Log Message:
In ping6, there's no blank space in the ping packets by default.

- document that if you use -p to specify a fill pattern you need to
make the packets bigger with -s;

- warn if -p is used and there's not at least one byte of fill space.

PR 56057


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sbin/ping6/ping6.8
cvs rdiff -u -r1.104 -r1.105 src/sbin/ping6/ping6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/ping6/ping6.8
diff -u src/sbin/ping6/ping6.8:1.33 src/sbin/ping6/ping6.8:1.34
--- src/sbin/ping6/ping6.8:1.33	Mon Apr 23 18:44:39 2018
+++ src/sbin/ping6/ping6.8	Mon Jun  7 22:13:34 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ping6.8,v 1.33 2018/04/23 18:44:39 maxv Exp $
+.\"	$NetBSD: ping6.8,v 1.34 2021/06/07 22:13:34 dholland Exp $
 .\"	$KAME: ping6.8,v 1.57 2002/05/26 13:18:25 itojun Exp $
 .\"
 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -28,7 +28,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd April 23, 2018
+.Dd June 7, 2021
 .Dt PING6 8
 .Os
 .Sh NAME
@@ -202,6 +202,10 @@ For example,
 .Dq Li \-p ff
 will cause the sent packet to be filled with all
 ones.
+Note that for IPv6 there is no fill space by default so it is
+necessary to also use the
+.Fl s
+option to expand the packet.
 .\" new IPsec
 .It Fl q
 Quiet output.

Index: src/sbin/ping6/ping6.c
diff -u src/sbin/ping6/ping6.c:1.104 src/sbin/ping6/ping6.c:1.105
--- src/sbin/ping6/ping6.c:1.104	Sun May 23 07:17:50 2021
+++ src/sbin/ping6/ping6.c	Mon Jun  7 22:13:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping6.c,v 1.104 2021/05/23 07:17:50 thorpej Exp $	*/
+/*	$NetBSD: ping6.c,v 1.105 2021/06/07 22:13:34 dholland Exp $	*/
 /*	$KAME: ping6.c,v 1.164 2002/11/16 14:05:37 itojun Exp $	*/
 
 /*
@@ -77,7 +77,7 @@ static char sccsid[] = "@(#)ping.c	8.1 (
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ping6.c,v 1.104 2021/05/23 07:17:50 thorpej Exp $");
+__RCSID("$NetBSD: ping6.c,v 1.105 2021/06/07 22:13:34 dholland Exp $");
 #endif
 #endif
 
@@ -569,6 +569,10 @@ main(int argc, char *argv[])
 	} else
 		target = argv[argc - 1];
 
+	if ((options & F_PINGFILLED) != 0 && datalen <= (int)ICMP6ECHOTMLEN) {
+		warnx("-p: No fill space; increase packet size with -s");
+	}
+
 	/* getaddrinfo */
 	memset(&hints, 0, sizeof(struct addrinfo));
 	hints.ai_flags = AI_CANONNAME;

Reply via email to