diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-01-02 09:21:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-01-02 09:21:08 +0000 |
commit | 5ec8bf97eb61afe45e84d47458c3c9cbfa46fc51 (patch) | |
tree | 273bd1ab001eb68d4820bbcb6be2174e914ecc03 /lib/libc/rpc/clnt_udp.c | |
parent | 19f6c2ec784db0d6a68883d75fe9b14c85baa98c (diff) |
use arc4random for xid generation
Diffstat (limited to 'lib/libc/rpc/clnt_udp.c')
-rw-r--r-- | lib/libc/rpc/clnt_udp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c index 796c9bf523a..5fbd082597d 100644 --- a/lib/libc/rpc/clnt_udp.c +++ b/lib/libc/rpc/clnt_udp.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: clnt_udp.c,v 1.9 1996/11/14 06:51:48 etheisen Exp $"; +static char *rcsid = "$OpenBSD: clnt_udp.c,v 1.10 1997/01/02 09:21:05 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -115,10 +115,6 @@ clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) register struct cu_data *cu; struct timeval now; struct rpc_msg call_msg; - static u_int32_t disrupt; - - if (disrupt == 0) - disrupt = (u_int32_t)(long)raddr; cl = (CLIENT *)mem_alloc(sizeof(CLIENT)); if (cl == NULL) { @@ -156,7 +152,7 @@ clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) cu->cu_total.tv_usec = -1; cu->cu_sendsz = sendsz; cu->cu_recvsz = recvsz; - 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 = program; |