]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - net/sunrpc/auth.c
SUNRPC: New xdr_streams XDR encoder API
[mirror_ubuntu-jammy-kernel.git] / net / sunrpc / auth.c
index afe67849269f52faaad4ee242d47d5645ad4005f..651c9da703cb604861f7cf1b5cc3921cdaae56c3 100644 (file)
@@ -563,8 +563,17 @@ rpcauth_checkverf(struct rpc_task *task, __be32 *p)
        return cred->cr_ops->crvalidate(task, p);
 }
 
+static void rpcauth_wrap_req_encode(kxdreproc_t encode, struct rpc_rqst *rqstp,
+                                  __be32 *data, void *obj)
+{
+       struct xdr_stream xdr;
+
+       xdr_init_encode(&xdr, &rqstp->rq_snd_buf, data);
+       encode(rqstp, &xdr, obj);
+}
+
 int
-rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp,
+rpcauth_wrap_req(struct rpc_task *task, kxdreproc_t encode, void *rqstp,
                __be32 *data, void *obj)
 {
        struct rpc_cred *cred = task->tk_rqstp->rq_cred;
@@ -574,7 +583,8 @@ rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp,
        if (cred->cr_ops->crwrap_req)
                return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj);
        /* By default, we encode the arguments normally. */
-       return encode(rqstp, data, obj);
+       rpcauth_wrap_req_encode(encode, rqstp, data, obj);
+       return 0;
 }
 
 int