These were left behind in
revision 1.225
date: 2018/04/11 16:03:58; author: zhuk; state: Exp; lines: +4 -4;
commitid: 3LTLgJehHSWyW63G;
Two fixes in ping:
1. Stop telling our PID to the world: the ident values could overlap
anyway since PID space is larger than 16 bits for some time already.
2. No need for htons/ntohs dance with ident in IPv6 case.
okay benno@ deraadt@ florian@
OK?
Index: ping.c
===================================================================
RCS file: /cvs/src/sbin/ping/ping.c,v
retrieving revision 1.229
diff -u -p -r1.229 ping.c
--- ping.c 14 Oct 2018 11:00:56 -0000 1.229
+++ ping.c 14 Oct 2018 19:19:47 -0000
@@ -178,7 +178,7 @@ u_char *outpack = outpackhdr+sizeof(stru
char BSPACE = '\b'; /* characters written for flood */
char DOT = '.';
char *hostname;
-int ident; /* process id to identify our packets */
+int ident; /* random number to identify our packets */
int v6flag; /* are we ping6? */
/* counters */
@@ -1016,7 +1016,7 @@ retransmit(int s)
/*
* 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 a random number,
* 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.
@@ -1048,7 +1048,7 @@ pinger(int s)
icp->icmp_code = 0;
icp->icmp_cksum = 0;
icp->icmp_seq = seq;
- icp->icmp_id = ident; /* ID */
+ icp->icmp_id = ident;
}
CLR(ntohs(seq) % mx_dup_ck);