Module Name:    src
Committed By:   rillig
Date:           Fri Jun 11 18:47:56 UTC 2021

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

Log Message:
ping, ping6: fix comment about ID field

Since ping.c 1.76 and ping6.c 1.58 from 2004-04-22, the ID field
contains random bits instead of a process ID.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sbin/ping/ping.c
cvs rdiff -u -r1.105 -r1.106 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/ping/ping.c
diff -u src/sbin/ping/ping.c:1.117 src/sbin/ping/ping.c:1.118
--- src/sbin/ping/ping.c:1.117	Mon Oct  2 10:08:11 2017
+++ src/sbin/ping/ping.c	Fri Jun 11 18:47:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping.c,v 1.117 2017/10/02 10:08:11 maya Exp $	*/
+/*	$NetBSD: ping.c,v 1.118 2021/06/11 18:47:56 rillig Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -58,7 +58,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ping.c,v 1.117 2017/10/02 10:08:11 maya Exp $");
+__RCSID("$NetBSD: ping.c,v 1.118 2021/06/11 18:47:56 rillig Exp $");
 #endif
 
 #include <stdio.h>
@@ -187,7 +187,7 @@ static int optlen;
 static int npackets;				/* total packets to send */
 static int preload;				/* number of packets to "preload" */
 static int ntransmitted;			/* output sequence # = #sent */
-static int ident;				/* our ID, in network byte order */
+static int ident;				/* 16 random bits to identify our packets */
 
 static int nreceived;				/* # of packets we got back */
 
@@ -884,7 +884,7 @@ jiggle(int delta)
 
 /*
  * Compose and transmit an ICMP ECHO REQUEST packet.  The IP packet
- * will be added on by the kernel.  The ID field is our UNIX process ID,
+ * will be added on by the kernel.  The ID field is random,
  * and the sequence number is an ascending integer.  The first phdrlen bytes
  * of the data portion are used to hold a UNIX "timeval" struct in VAX
  * byte-order, to compute the round-trip time, or a UNIX "timespec" in native

Index: src/sbin/ping6/ping6.c
diff -u src/sbin/ping6/ping6.c:1.105 src/sbin/ping6/ping6.c:1.106
--- src/sbin/ping6/ping6.c:1.105	Mon Jun  7 22:13:34 2021
+++ src/sbin/ping6/ping6.c	Fri Jun 11 18:47:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping6.c,v 1.105 2021/06/07 22:13:34 dholland Exp $	*/
+/*	$NetBSD: ping6.c,v 1.106 2021/06/11 18:47:56 rillig 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.105 2021/06/07 22:13:34 dholland Exp $");
+__RCSID("$NetBSD: ping6.c,v 1.106 2021/06/11 18:47:56 rillig Exp $");
 #endif
 #endif
 
@@ -205,7 +205,7 @@ static u_char outpack[MAXPACKETLEN] __al
 static char BSPACE = '\b';		/* characters written for flood */
 static char DOT = '.';
 static char *hostname;
-static int ident;			/* process id to identify our packets */
+static int ident;			/* 16 random bits to identify our packets */
 static u_int8_t nonce[8];		/* nonce field for node information */
 static int hoplimit = -1;		/* hoplimit */
 
@@ -1055,7 +1055,7 @@ onsignal(int sig)
 /*
  * pinger --
  *	Compose and transmit an ICMP ECHO REQUEST packet.  The IP packet
- * will be added on by the kernel.  The ID field is our UNIX process ID,
+ * will be added on by the kernel.  The ID field is random,
  * and the sequence number is an ascending integer.  The first 8 bytes
  * of the data portion are used to hold a UNIX "timeval" struct in VAX
  * byte-order, to compute the round-trip time.

Reply via email to