Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/nfs/nfs_subs.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/nfs/nfs_subs.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.29 retrieving revision 1.30 diff -u -p -r1.29 -r1.30 --- src/sys/nfs/nfs_subs.c 1996/07/01 10:22:47 1.29 +++ src/sys/nfs/nfs_subs.c 1996/07/07 12:23:49 1.30 @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_subs.c,v 1.29 1996/07/01 10:22:47 fvdl Exp $ */ +/* $NetBSD: nfs_subs.c,v 1.30 1996/07/07 12:23:49 fvdl Exp $ */ /* * Copyright (c) 1989, 1993 @@ -55,6 +55,7 @@ #include #include #include +#include #include @@ -609,6 +610,8 @@ nfsm_rpchead(cr, nmflag, procid, auth_ty register int i; struct mbuf *mreq, *mb2; int siz, grpsiz, authsiz; + struct timeval tv; + static u_int32_t base; authsiz = nfsm_rndup(auth_len); MGETHDR(mb, M_WAIT, MT_DATA); @@ -627,8 +630,22 @@ nfsm_rpchead(cr, nmflag, procid, auth_ty * First the RPC header. */ nfsm_build(tl, u_int32_t *, 8 * NFSX_UNSIGNED); + + /* + * derive initial xid from system time + * XXX time is invalid if root not yet mounted + */ + if (!base && (rootvp)) { + microtime(&tv); + base = tv.tv_sec << 12; + nfs_xid = base; + } + /* + * Skip zero xid if it should ever happen. + */ if (++nfs_xid == 0) nfs_xid++; + *tl++ = *xidp = txdr_unsigned(nfs_xid); *tl++ = rpc_call; *tl++ = rpc_vers;