diff options
Diffstat (limited to 'sys/nfs/nfs_common.h')
-rw-r--r-- | sys/nfs/nfs_common.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sys/nfs/nfs_common.h b/sys/nfs/nfs_common.h index c2677c8076b6..e33be829e66e 100644 --- a/sys/nfs/nfs_common.h +++ b/sys/nfs/nfs_common.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95 - * $Id$ + * $Id: nfsm_subs.h,v 1.12 1997/02/22 09:42:48 peter Exp $ */ @@ -363,18 +363,24 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid, } } #define nfsm_srvmtofh(f) \ - { if (nfsd->nd_flag & ND_NFSV3) { \ + { int fhlen = NFSX_V3FH; \ + if (nfsd->nd_flag & ND_NFSV3) { \ nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \ - if (fxdr_unsigned(int, *tl) != NFSX_V3FH) { \ + fhlen = fxdr_unsigned(int, *tl); \ + if (fhlen == 0) { \ + bzero((caddr_t)(f), NFSX_V3FH); \ + } else if (fhlen != NFSX_V3FH) { \ error = EBADRPC; \ nfsm_reply(0); \ } \ } \ - nfsm_dissect(tl, u_long *, NFSX_V3FH); \ - bcopy((caddr_t)tl, (caddr_t)(f), NFSX_V3FH); \ - if ((nfsd->nd_flag & ND_NFSV3) == 0) \ - nfsm_adv(NFSX_V2FH - NFSX_V3FH); \ - } + if (fhlen != 0) { \ + nfsm_dissect(tl, u_long *, NFSX_V3FH); \ + bcopy((caddr_t)tl, (caddr_t)(f), NFSX_V3FH); \ + if ((nfsd->nd_flag & ND_NFSV3) == 0) \ + nfsm_adv(NFSX_V2FH - NFSX_V3FH); \ + } \ + } #define nfsm_clget \ if (bp >= be) { \ |