aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c10
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);
570void rpc_force_rebind(struct rpc_clnt *clnt) 569void 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}
575EXPORT_SYMBOL(rpc_force_rebind); 574EXPORT_SYMBOL(rpc_force_rebind);
576 575
@@ -782,14 +781,15 @@ static void
782call_bind(struct rpc_task *task) 781call_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}