summaryrefslogtreecommitdiff
path: root/lib/libc/rpc/clnt_tcp.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-01-02 09:21:08 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-01-02 09:21:08 +0000
commit5ec8bf97eb61afe45e84d47458c3c9cbfa46fc51 (patch)
tree273bd1ab001eb68d4820bbcb6be2174e914ecc03 /lib/libc/rpc/clnt_tcp.c
parent19f6c2ec784db0d6a68883d75fe9b14c85baa98c (diff)
use arc4random for xid generation
Diffstat (limited to 'lib/libc/rpc/clnt_tcp.c')
-rw-r--r--lib/libc/rpc/clnt_tcp.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c
index 3cc332244ad..f23e97afb9b 100644
--- a/lib/libc/rpc/clnt_tcp.c
+++ b/lib/libc/rpc/clnt_tcp.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.11 1996/12/10 07:46:37 deraadt Exp $";
+static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.12 1997/01/02 09:21:01 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -119,10 +119,6 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
register struct ct_data *ct;
struct timeval now;
struct rpc_msg call_msg;
- static u_int32_t disrupt;
-
- if (disrupt == 0)
- disrupt = (u_int32_t)(long)raddr;
h = (CLIENT *)mem_alloc(sizeof(*h));
if (h == NULL) {
@@ -184,7 +180,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
* Initialize call message
*/
(void)gettimeofday(&now, (struct timezone *)0);
- call_msg.rm_xid = (++disrupt) ^ getpid() ^ now.tv_sec ^ now.tv_usec;
+ call_msg.rm_xid = arc4random();
call_msg.rm_direction = CALL;
call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
call_msg.rm_call.cb_prog = prog;