For NFSV3CREATE_EXCLUSIVE verifier, just use arc4random() instead
of the first inet address on INET systems (which is likely to be localhost).
This commit is contained in:
parent
513be93faf
commit
c66ebd3d57
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: nfs_vnops.c,v 1.266 2008/02/13 09:51:37 yamt Exp $ */
|
||||
/* $NetBSD: nfs_vnops.c,v 1.267 2008/10/15 14:21:35 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
|
@ -39,9 +39,8 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.266 2008/02/13 09:51:37 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.267 2008/10/15 14:21:35 pooka Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_nfs.h"
|
||||
#include "opt_uvmhist.h"
|
||||
|
||||
|
@ -1629,9 +1628,6 @@ nfs_mknod(v)
|
|||
return (error);
|
||||
}
|
||||
|
||||
#ifndef NFS_V2_ONLY
|
||||
static u_long create_verf;
|
||||
#endif
|
||||
/*
|
||||
* nfs file create call
|
||||
*/
|
||||
|
@ -1687,16 +1683,8 @@ again:
|
|||
if (excl_mode == NFSV3CREATE_EXCLUSIVE) {
|
||||
*tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
|
||||
nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
|
||||
#ifdef INET
|
||||
if (TAILQ_FIRST(&in_ifaddrhead))
|
||||
*tl++ = TAILQ_FIRST(&in_ifaddrhead)->
|
||||
ia_addr.sin_addr.s_addr;
|
||||
else
|
||||
*tl++ = create_verf;
|
||||
#else
|
||||
*tl++ = create_verf;
|
||||
#endif
|
||||
*tl = ++create_verf;
|
||||
*tl++ = arc4random();
|
||||
*tl = arc4random();
|
||||
} else {
|
||||
*tl = txdr_unsigned(excl_mode);
|
||||
nfsm_v3attrbuild(vap, false);
|
||||
|
|
Loading…
Reference in New Issue