diff options
Diffstat (limited to 'net/sunrpc/pmap_clnt.c')
-rw-r--r-- | net/sunrpc/pmap_clnt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c index 623180f224c9..209ffdfee10b 100644 --- a/net/sunrpc/pmap_clnt.c +++ b/net/sunrpc/pmap_clnt.c | |||
@@ -142,15 +142,17 @@ pmap_getport_done(struct rpc_task *task) | |||
142 | dprintk("RPC: %4d pmap_getport_done(status %d, port %d)\n", | 142 | dprintk("RPC: %4d pmap_getport_done(status %d, port %d)\n", |
143 | task->tk_pid, task->tk_status, clnt->cl_port); | 143 | task->tk_pid, task->tk_status, clnt->cl_port); |
144 | 144 | ||
145 | xprt->ops->set_port(xprt, 0); | ||
146 | if (task->tk_status < 0) { | 145 | if (task->tk_status < 0) { |
147 | /* Make the calling task exit with an error */ | 146 | /* Make the calling task exit with an error */ |
147 | xprt->ops->set_port(xprt, 0); | ||
148 | task->tk_action = rpc_exit_task; | 148 | task->tk_action = rpc_exit_task; |
149 | } else if (clnt->cl_port == 0) { | 149 | } else if (clnt->cl_port == 0) { |
150 | /* Program not registered */ | 150 | /* Program not registered */ |
151 | xprt->ops->set_port(xprt, 0); | ||
151 | rpc_exit(task, -EACCES); | 152 | rpc_exit(task, -EACCES); |
152 | } else { | 153 | } else { |
153 | xprt->ops->set_port(xprt, clnt->cl_port); | 154 | xprt->ops->set_port(xprt, clnt->cl_port); |
155 | xprt_set_bound(xprt); | ||
154 | clnt->cl_port = htons(clnt->cl_port); | 156 | clnt->cl_port = htons(clnt->cl_port); |
155 | } | 157 | } |
156 | spin_lock(&pmap_lock); | 158 | spin_lock(&pmap_lock); |
@@ -218,6 +220,7 @@ pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileg | |||
218 | if (IS_ERR(xprt)) | 220 | if (IS_ERR(xprt)) |
219 | return (struct rpc_clnt *)xprt; | 221 | return (struct rpc_clnt *)xprt; |
220 | xprt->ops->set_port(xprt, RPC_PMAP_PORT); | 222 | xprt->ops->set_port(xprt, RPC_PMAP_PORT); |
223 | xprt_set_bound(xprt); | ||
221 | if (!privileged) | 224 | if (!privileged) |
222 | xprt->resvport = 0; | 225 | xprt->resvport = 0; |
223 | 226 | ||