diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2006-08-22 20:06:15 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-09-22 23:24:39 -0400 |
commit | ec739ef03dc926d05051c8c5838971445504470a (patch) | |
tree | 940d3dafd873c159c1279ade15ba11ede1d12983 /net/sunrpc/clnt.c | |
parent | 9c5bf38d85a31b946664bcc21078ef5bb10672f7 (diff) |
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/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 3e19d321067a..0b8d03d08561 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -148,7 +148,6 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, | |||
148 | clnt->cl_maxproc = version->nrprocs; | 148 | clnt->cl_maxproc = version->nrprocs; |
149 | clnt->cl_protname = program->name; | 149 | clnt->cl_protname = program->name; |
150 | clnt->cl_pmap = &clnt->cl_pmap_default; | 150 | clnt->cl_pmap = &clnt->cl_pmap_default; |
151 | clnt->cl_port = xprt->addr.sin_port; | ||
152 | clnt->cl_prog = program->number; | 151 | clnt->cl_prog = program->number; |
153 | clnt->cl_vers = version->number; | 152 | clnt->cl_vers = version->number; |
154 | clnt->cl_prot = xprt->prot; | 153 | clnt->cl_prot = xprt->prot; |
@@ -156,7 +155,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, | |||
156 | clnt->cl_metrics = rpc_alloc_iostats(clnt); | 155 | clnt->cl_metrics = rpc_alloc_iostats(clnt); |
157 | rpc_init_wait_queue(&clnt->cl_pmap_default.pm_bindwait, "bindwait"); | 156 | rpc_init_wait_queue(&clnt->cl_pmap_default.pm_bindwait, "bindwait"); |
158 | 157 | ||
159 | if (!clnt->cl_port) | 158 | if (!xprt_bound(clnt->cl_xprt)) |
160 | clnt->cl_autobind = 1; | 159 | clnt->cl_autobind = 1; |
161 | 160 | ||
162 | clnt->cl_rtt = &clnt->cl_rtt_default; | 161 | clnt->cl_rtt = &clnt->cl_rtt_default; |
@@ -570,7 +569,7 @@ EXPORT_SYMBOL(rpc_max_payload); | |||
570 | void rpc_force_rebind(struct rpc_clnt *clnt) | 569 | void rpc_force_rebind(struct rpc_clnt *clnt) |
571 | { | 570 | { |
572 | if (clnt->cl_autobind) | 571 | if (clnt->cl_autobind) |
573 | clnt->cl_port = 0; | 572 | xprt_clear_bound(clnt->cl_xprt); |
574 | } | 573 | } |
575 | EXPORT_SYMBOL(rpc_force_rebind); | 574 | EXPORT_SYMBOL(rpc_force_rebind); |
576 | 575 | ||
@@ -782,14 +781,15 @@ static void | |||
782 | call_bind(struct rpc_task *task) | 781 | call_bind(struct rpc_task *task) |
783 | { | 782 | { |
784 | struct rpc_clnt *clnt = task->tk_client; | 783 | struct rpc_clnt *clnt = task->tk_client; |
784 | struct rpc_xprt *xprt = task->tk_xprt; | ||
785 | 785 | ||
786 | dprintk("RPC: %4d call_bind (status %d)\n", | 786 | dprintk("RPC: %4d call_bind (status %d)\n", |
787 | task->tk_pid, task->tk_status); | 787 | task->tk_pid, task->tk_status); |
788 | 788 | ||
789 | task->tk_action = call_connect; | 789 | task->tk_action = call_connect; |
790 | if (!clnt->cl_port) { | 790 | if (!xprt_bound(xprt)) { |
791 | task->tk_action = call_bind_status; | 791 | task->tk_action = call_bind_status; |
792 | task->tk_timeout = task->tk_xprt->bind_timeout; | 792 | task->tk_timeout = xprt->bind_timeout; |
793 | rpc_getport(task, clnt); | 793 | rpc_getport(task, clnt); |
794 | } | 794 | } |
795 | } | 795 | } |