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
This commit is contained in:
dholland 2021-06-07 22:13:34 +00:00
parent 976049247d
commit fcb4d9ad2e
2 changed files with 12 additions and 4 deletions

View File

@ -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.

View File

@ -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 (Berkeley) 6/5/93";
#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;