SUNRPC: use proper network namespace in rpcbind RPCBPROC_GETADDR procedure
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Fri, 13 Jan 2012 10:02:40 +0000 (14:02 +0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 1 Feb 2012 00:28:13 +0000 (19:28 -0500)
Pass request socket network namespace to rpc_uaddr2sockaddr() instead of
hardcoded "init_net",  when decoding address in RPCBPROC_GETADDR procedure.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/rpcb_clnt.c

index 7c6fac00444747c54fc7d275580a4117d76471de..4ce3a8e0295326cec3bc91e5c3b7c2cac5f2b53a 100644 (file)
@@ -934,7 +934,8 @@ static int rpcb_dec_getaddr(struct rpc_rqst *req, struct xdr_stream *xdr,
        dprintk("RPC: %5u RPCB_%s reply: %s\n", task->tk_pid,
                        task->tk_msg.rpc_proc->p_name, (char *)p);
 
-       if (rpc_uaddr2sockaddr(&init_net, (char *)p, len, sap, sizeof(address)) == 0)
+       if (rpc_uaddr2sockaddr(req->rq_xprt->xprt_net, (char *)p, len,
+                               sap, sizeof(address)) == 0)
                goto out_fail;
        rpcb->r_port = rpc_get_port(sap);