From owner-svn-src-all@FreeBSD.ORG Sat May 16 03:12:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F3D1065687; Sat, 16 May 2009 03:12:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87CC08FC1C; Sat, 16 May 2009 03:12:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4G3CuAf042784; Sat, 16 May 2009 03:12:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4G3CuCw042782; Sat, 16 May 2009 03:12:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200905160312.n4G3CuCw042782@svn.freebsd.org> From: Rick Macklem Date: Sat, 16 May 2009 03:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192181 - in head/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2009 03:12:57 -0000 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. */