svn commit: r201345 - head/sys/fs/nfsclient

Rick Macklem rmacklem at FreeBSD.org
Thu Dec 31 18:02:48 UTC 2009


Author: rmacklem
Date: Thu Dec 31 18:02:48 2009
New Revision: 201345
URL: http://svn.freebsd.org/changeset/base/201345

Log:
  Fix the experimental NFS client so that it can create Unix
  domain sockets on an NFSv4 mount point. It was generating
  incorrect XDR in the request for this case.
  
  Tested by:	infofarmer
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clrpcops.c

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clrpcops.c	Thu Dec 31 17:44:24 2009	(r201344)
+++ head/sys/fs/nfsclient/nfs_clrpcops.c	Thu Dec 31 18:02:48 2009	(r201345)
@@ -1626,10 +1626,15 @@ nfsrpc_mknod(vnode_t dvp, char *name, in
 		return (ENAMETOOLONG);
 	NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp);
 	if (nd->nd_flag & ND_NFSV4) {
-		NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
-		*tl++ = vtonfsv34_type(vtyp);
-		*tl++ = txdr_unsigned(NFSMAJOR(rdev));
-		*tl = txdr_unsigned(NFSMINOR(rdev));
+		if (vtyp == VBLK || vtyp == VCHR) {
+			NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
+			*tl++ = vtonfsv34_type(vtyp);
+			*tl++ = txdr_unsigned(NFSMAJOR(rdev));
+			*tl = txdr_unsigned(NFSMINOR(rdev));
+		} else {
+			NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED);
+			*tl = vtonfsv34_type(vtyp);
+		}
 	}
 	(void) nfsm_strtom(nd, name, namelen);
 	if (nd->nd_flag & ND_NFSV3) {


More information about the svn-src-all mailing list