summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/clnt_tcp.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-04-27 22:23:31 +0000
committerderaadt <deraadt@openbsd.org>1997-04-27 22:23:31 +0000
commit76404e9a11da6ab2eae0ab0e77581010413019eb (patch)
tree75143bd5dfea16bb3cca5f6f0505f1ef1719741c /lib/libc/rpc/clnt_tcp.c
parenthandle hex-like hostnames (diff)
downloadwireguard-openbsd-76404e9a11da6ab2eae0ab0e77581010413019eb.tar.xz
wireguard-openbsd-76404e9a11da6ab2eae0ab0e77581010413019eb.zip
re-randomize xid on reuse of a CLIENT *; pointed out by adam@math.tau.ac.il
Diffstat (limited to 'lib/libc/rpc/clnt_tcp.c')
-rw-r--r--lib/libc/rpc/clnt_tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c
index f23e97afb9b..387521d4063 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.12 1997/01/02 09:21:01 deraadt Exp $";
+static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.13 1997/04/27 22:23:31 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -251,7 +251,7 @@ clnttcp_call(h, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
call_again:
xdrs->x_op = XDR_ENCODE;
ct->ct_error.re_status = RPC_SUCCESS;
- x_id = ntohl(--(*msg_x_id));
+ x_id = *msg_x_id = arc4random();
if ((! XDR_PUTBYTES(xdrs, ct->ct_mcall, ct->ct_mpos)) ||
(! XDR_PUTLONG(xdrs, (long *)&proc)) ||
(! AUTH_MARSHALL(h->cl_auth, xdrs)) ||