diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2009-12-31 18:02:48 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2009-12-31 18:02:48 +0000 |
commit | 71291348da8fb112f156fd6f7e0b0e3d44f1f485 (patch) | |
tree | f7abf8290d3168664f2797b2d41a8030a02c312e | |
parent | 9f56916a97d5af44789eba5f567e44a49dbec53c (diff) | |
download | FreeBSD-src-71291348da8fb112f156fd6f7e0b0e3d44f1f485.zip FreeBSD-src-71291348da8fb112f156fd6f7e0b0e3d44f1f485.tar.gz |
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
-rw-r--r-- | sys/fs/nfsclient/nfs_clrpcops.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 22cfa97..95943a9 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -1626,10 +1626,15 @@ nfsrpc_mknod(vnode_t dvp, char *name, int namelen, struct vattr *vap, 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) { |