summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2009-05-16 03:12:55 +0000
committerrmacklem <rmacklem@FreeBSD.org>2009-05-16 03:12:55 +0000
commit75b506904d458f96abbb04bd5407d7f0a8b48eda (patch)
treeff2b242b42322fcfa14ac22e134230a796045712 /sys/fs
parent9919b017d404ed3ee864f5086aa49f17bfe2e026 (diff)
downloadFreeBSD-src-75b506904d458f96abbb04bd5407d7f0a8b48eda.zip
FreeBSD-src-75b506904d458f96abbb04bd5407d7f0a8b48eda.tar.gz
Fixed the Null callback RPCs so that they work with the new krpc. This
required two changes: setting the program and version numbers before connect and fixing the handling of the Null Rpc case in newnfs_request(). Approved by: kib (mentor)
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfs/nfs_commonkrpc.c19
-rw-r--r--sys/fs/nfsserver/nfs_nfsdstate.c8
2 files changed, 18 insertions, 9 deletions
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
index 429eed2..6e27e4d 100644
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -456,7 +456,9 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
if (nrp->nr_client == NULL)
newnfs_connect(nmp, nrp, cred, td, 0);
- if (usegssname)
+ if (nd->nd_procnum == NFSPROC_NULL)
+ auth = authnone_create();
+ else if (usegssname)
auth = nfs_getauth(nrp, secflavour, nmp->nm_krbname,
srv_principal, NULL, cred);
else
@@ -475,7 +477,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
procnum = nd->nd_procnum;
if ((nd->nd_flag & ND_NFSV4) &&
- nd->nd_procnum != NFSV4PROC_CBNULL &&
+ nd->nd_procnum != NFSPROC_NULL &&
nd->nd_procnum != NFSV4PROC_CBCOMPOUND)
procnum = NFSV4PROC_COMPOUND;
@@ -672,14 +674,13 @@ tryagain:
rep != NULL && (rep->r_flags & R_DONTRECOVER))
nd->nd_repstat = NFSERR_STALEDONTRECOVER;
}
-
- m_freem(nd->nd_mreq);
- AUTH_DESTROY(auth);
- if (rep != NULL)
- FREE((caddr_t)rep, M_NFSDREQ);
- return (0);
}
- error = EPROTONOSUPPORT;
+
+ m_freem(nd->nd_mreq);
+ AUTH_DESTROY(auth);
+ if (rep != NULL)
+ FREE((caddr_t)rep, M_NFSDREQ);
+ return (0);
nfsmout:
mbuf_freem(nd->nd_mrep);
mbuf_freem(nd->nd_mreq);
diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
index e312cb1..f33c59a 100644
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -3560,6 +3560,14 @@ nfsrv_docallback(struct nfsclient *clp, int procnum,
panic("docallb");
}
clp->lc_cbref++;
+
+ /*
+ * Fill the callback program# and version into the request
+ * structure for newnfs_connect() to use.
+ */
+ clp->lc_req.nr_prog = clp->lc_program;
+ clp->lc_req.nr_vers = NFSV4_CBVERS;
+
/*
* First, fill in some of the fields of nd and cr.
*/
OpenPOWER on IntegriCloud