Subject: rpc xid randomness
To: None <tech-userlevel@netbsd.org>
From: Jun-ichiro itojun Hagino <itojun@iijlab.net>
List: tech-userlevel
Date: 09/06/2003 20:59:19
	does it have any negative sideeffects?  i mean, is there any code that
	relies on xid being generated from timestamp?

itojun


Index: rpc/rpc_internal.h
===================================================================
RCS file: /cvsroot/src/lib/libc/rpc/rpc_internal.h,v
retrieving revision 1.2
diff -u -r1.2 rpc_internal.h
--- rpc/rpc_internal.h	2003/01/18 11:29:05	1.2
+++ rpc/rpc_internal.h	2003/09/06 11:58:26
@@ -34,8 +34,7 @@
 
 char *_get_next_token __P((char *, int));
 
-#define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
-    (u_int32_t)(now)->tv_usec)
+#define __RPC_GETXID(now)	(arc4random())
 
 extern SVCXPRT **__svc_xports;
 extern int __svc_maxrec;