diff options
Diffstat (limited to 'net/sunrpc/pmap_clnt.c')
-rw-r--r-- | net/sunrpc/pmap_clnt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c index cad4568fbbe2..0935adb91b3c 100644 --- a/net/sunrpc/pmap_clnt.c +++ b/net/sunrpc/pmap_clnt.c | |||
@@ -131,10 +131,13 @@ static void | |||
131 | pmap_getport_done(struct rpc_task *task) | 131 | pmap_getport_done(struct rpc_task *task) |
132 | { | 132 | { |
133 | struct rpc_clnt *clnt = task->tk_client; | 133 | struct rpc_clnt *clnt = task->tk_client; |
134 | struct rpc_xprt *xprt = task->tk_xprt; | ||
134 | struct rpc_portmap *map = clnt->cl_pmap; | 135 | struct rpc_portmap *map = clnt->cl_pmap; |
135 | 136 | ||
136 | dprintk("RPC: %4d pmap_getport_done(status %d, port %d)\n", | 137 | dprintk("RPC: %4d pmap_getport_done(status %d, port %d)\n", |
137 | task->tk_pid, task->tk_status, clnt->cl_port); | 138 | task->tk_pid, task->tk_status, clnt->cl_port); |
139 | |||
140 | xprt->ops->set_port(xprt, 0); | ||
138 | if (task->tk_status < 0) { | 141 | if (task->tk_status < 0) { |
139 | /* Make the calling task exit with an error */ | 142 | /* Make the calling task exit with an error */ |
140 | task->tk_action = rpc_exit_task; | 143 | task->tk_action = rpc_exit_task; |
@@ -142,9 +145,8 @@ pmap_getport_done(struct rpc_task *task) | |||
142 | /* Program not registered */ | 145 | /* Program not registered */ |
143 | rpc_exit(task, -EACCES); | 146 | rpc_exit(task, -EACCES); |
144 | } else { | 147 | } else { |
145 | /* byte-swap port number first */ | 148 | xprt->ops->set_port(xprt, clnt->cl_port); |
146 | clnt->cl_port = htons(clnt->cl_port); | 149 | clnt->cl_port = htons(clnt->cl_port); |
147 | clnt->cl_xprt->addr.sin_port = clnt->cl_port; | ||
148 | } | 150 | } |
149 | spin_lock(&pmap_lock); | 151 | spin_lock(&pmap_lock); |
150 | map->pm_binding = 0; | 152 | map->pm_binding = 0; |
@@ -205,7 +207,7 @@ pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileg | |||
205 | xprt = xprt_create_proto(proto, srvaddr, NULL); | 207 | xprt = xprt_create_proto(proto, srvaddr, NULL); |
206 | if (IS_ERR(xprt)) | 208 | if (IS_ERR(xprt)) |
207 | return (struct rpc_clnt *)xprt; | 209 | return (struct rpc_clnt *)xprt; |
208 | xprt->addr.sin_port = htons(RPC_PMAP_PORT); | 210 | xprt->ops->set_port(xprt, RPC_PMAP_PORT); |
209 | if (!privileged) | 211 | if (!privileged) |
210 | xprt->resvport = 0; | 212 | xprt->resvport = 0; |
211 | 213 | ||