svn commit: r192181 - in head/sys/fs: nfs nfsserver

Rick Macklem rmacklem at FreeBSD.org
Sat May 16 03:12:57 UTC 2009


Author: rmacklem
Date: Sat May 16 03:12:55 2009
New Revision: 192181
URL: http://svn.freebsd.org/changeset/base/192181

Log:
  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)

Modified:
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonkrpc.c	Sat May 16 02:49:05 2009	(r192180)
+++ head/sys/fs/nfs/nfs_commonkrpc.c	Sat May 16 03:12:55 2009	(r192181)
@@ -456,7 +456,9 @@ newnfs_request(struct nfsrv_descript *nd
 	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
 
 	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);

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdstate.c	Sat May 16 02:49:05 2009	(r192180)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c	Sat May 16 03:12:55 2009	(r192181)
@@ -3560,6 +3560,14 @@ nfsrv_docallback(struct nfsclient *clp, 
 		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.
 	 */


More information about the svn-src-all mailing list