summaryrefslogtreecommitdiff
path: root/net/sunrpc/pmap_clnt.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2006-08-23 00:06:15 (GMT)
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-23 03:24:39 (GMT)
commitec739ef03dc926d05051c8c5838971445504470a (patch)
tree940d3dafd873c159c1279ade15ba11ede1d12983 /net/sunrpc/pmap_clnt.c
parent9c5bf38d85a31b946664bcc21078ef5bb10672f7 (diff)
downloadlinux-fsl-qoriq-ec739ef03dc926d05051c8c5838971445504470a.tar.xz
SUNRPC: Create a helper to tell whether a transport is bound
Hide the contents and format of xprt->addr by eliminating direct uses of the xprt->addr.sin_port field. This change is required to support alternate RPC host address formats (eg IPv6). Test-plan: Destructive testing (unplugging the network temporarily). Repeated runs of Connectathon locking suite with UDP and TCP. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/pmap_clnt.c')
-rw-r--r--net/sunrpc/pmap_clnt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c
index 623180f..209ffdf 100644
--- a/net/sunrpc/pmap_clnt.c
+++ b/net/sunrpc/pmap_clnt.c
@@ -142,15 +142,17 @@ pmap_getport_done(struct rpc_task *task)
dprintk("RPC: %4d pmap_getport_done(status %d, port %d)\n",
task->tk_pid, task->tk_status, clnt->cl_port);
- xprt->ops->set_port(xprt, 0);
if (task->tk_status < 0) {
/* Make the calling task exit with an error */
+ xprt->ops->set_port(xprt, 0);
task->tk_action = rpc_exit_task;
} else if (clnt->cl_port == 0) {
/* Program not registered */
+ xprt->ops->set_port(xprt, 0);
rpc_exit(task, -EACCES);
} else {
xprt->ops->set_port(xprt, clnt->cl_port);
+ xprt_set_bound(xprt);
clnt->cl_port = htons(clnt->cl_port);
}
spin_lock(&pmap_lock);
@@ -218,6 +220,7 @@ pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileg
if (IS_ERR(xprt))
return (struct rpc_clnt *)xprt;
xprt->ops->set_port(xprt, RPC_PMAP_PORT);
+ xprt_set_bound(xprt);
if (!privileged)
xprt->resvport = 0;