diff options
author | 1996-09-02 05:01:09 +0000 | |
---|---|---|
committer | 1996-09-02 05:01:09 +0000 | |
commit | a19f8807456b00b87b131cd5b5559a8720555f6a (patch) | |
tree | 5501e4f9866d91fdf0c7442242510d9e1ed58b9f /lib/libc | |
parent | do not leak byname; this needs a complete rewrite (diff) | |
download | wireguard-openbsd-a19f8807456b00b87b131cd5b5559a8720555f6a.tar.xz wireguard-openbsd-a19f8807456b00b87b131cd5b5559a8720555f6a.zip |
perturb xid further. confuse the world
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/rpc/clnt_tcp.c | 8 | ||||
-rw-r--r-- | lib/libc/rpc/clnt_udp.c | 8 | ||||
-rw-r--r-- | lib/libc/rpc/pmap_rmt.c | 8 |
3 files changed, 18 insertions, 6 deletions
diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c index e8c65ecabf0..a67673edd0e 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.7 1996/08/20 23:47:37 deraadt Exp $"; +static char *rcsid = "$OpenBSD: clnt_tcp.c,v 1.8 1996/09/02 05:01:09 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -119,6 +119,10 @@ 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)raddr; h = (CLIENT *)mem_alloc(sizeof(*h)); if (h == NULL) { @@ -179,7 +183,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) * Initialize call message */ (void)gettimeofday(&now, (struct timezone *)0); - call_msg.rm_xid = getpid() ^ now.tv_sec ^ now.tv_usec; + call_msg.rm_xid = (++disrupt) ^ getpid() ^ now.tv_sec ^ now.tv_usec; call_msg.rm_direction = CALL; call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION; call_msg.rm_call.cb_prog = prog; diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c index ee88b1c4c18..1d49f4a6d3d 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.7 1996/08/20 23:47:40 deraadt Exp $"; +static char *rcsid = "$OpenBSD: clnt_udp.c,v 1.8 1996/09/02 05:01:12 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -115,6 +115,10 @@ 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)raddr; cl = (CLIENT *)mem_alloc(sizeof(CLIENT)); if (cl == NULL) { @@ -152,7 +156,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 = getpid() ^ now.tv_sec ^ now.tv_usec; + call_msg.rm_xid = (++disrupt) ^ getpid() ^ now.tv_sec ^ now.tv_usec; call_msg.rm_direction = CALL; call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION; call_msg.rm_call.cb_prog = program; diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c index 68dab474cb9..0aa6faeb6b5 100644 --- a/lib/libc/rpc/pmap_rmt.c +++ b/lib/libc/rpc/pmap_rmt.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: pmap_rmt.c,v 1.8 1996/08/20 23:47:42 deraadt Exp $"; +static char *rcsid = "$OpenBSD: pmap_rmt.c,v 1.9 1996/09/02 05:01:14 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -238,6 +238,10 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) struct rpc_msg msg; struct timeval t; char outbuf[MAX_BROADCAST_SIZE], inbuf[UDPMSGSIZE]; + static u_int32_t disrupt; + + if (disrupt == 0) + disrupt = (u_int32_t)resultsp; /* * initialization: create a socket, a broadcast address, and @@ -276,7 +280,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) baddr.sin_port = htons(PMAPPORT); baddr.sin_addr.s_addr = htonl(INADDR_ANY); (void)gettimeofday(&t, (struct timezone *)0); - msg.rm_xid = xid = getpid() ^ t.tv_sec ^ t.tv_usec; + msg.rm_xid = xid = (++disrupt) ^ getpid() ^ t.tv_sec ^ t.tv_usec; t.tv_usec = 0; msg.rm_direction = CALL; msg.rm_call.cb_rpcvers = RPC_MSG_VERSION; |