*/
#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 */
/*
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)) ||
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: clnt_udp.c,v 1.10 1997/01/02 09:21:05 deraadt Exp $";
+static char *rcsid = "$OpenBSD: clnt_udp.c,v 1.11 1997/04/27 22:23:33 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
struct rpc_msg reply_msg;
XDR reply_xdrs;
struct timeval time_waited, start, after, tmp1, tmp2;
+ u_int32_t *msg_x_id = (u_int32_t *)(cu->cu_outbuf); /* yuk */
bool_t ok;
int nrefreshes = 2; /* number of times to refresh cred */
struct timeval timeout;
xdrs = &(cu->cu_outxdrs);
xdrs->x_op = XDR_ENCODE;
XDR_SETPOS(xdrs, cu->cu_xdrpos);
- /*
- * the transaction is the first thing in the out buffer
- */
- (*(u_short *)(cu->cu_outbuf))++;
+ *msg_x_id = arc4random();
if (!XDR_PUTLONG(xdrs, (long *)&proc) ||
!AUTH_MARSHALL(cl->cl_auth, xdrs) ||
!(*xargs)(xdrs, argsp)) {
if (inlen < sizeof(u_int32_t))
continue;
/* see if reply transaction id matches sent id */
- if (*((u_int32_t *)(cu->cu_inbuf)) != *((u_int32_t *)(cu->cu_outbuf)))
+ if (*((u_int32_t *)(cu->cu_inbuf)) != *msg_x_id)
continue;
/* we now assume we have the proper reply */
break;