diff options
-rw-r--r-- | net/sunrpc/pmap_clnt.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c index 523f0e825dea..f476f4df0f48 100644 --- a/net/sunrpc/pmap_clnt.c +++ b/net/sunrpc/pmap_clnt.c | |||
@@ -281,25 +281,22 @@ int rpc_register(u32 prog, u32 vers, int prot, unsigned short port, int *okay) | |||
281 | 281 | ||
282 | static struct rpc_clnt *pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileged) | 282 | static struct rpc_clnt *pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileged) |
283 | { | 283 | { |
284 | struct rpc_xprt *xprt; | 284 | struct rpc_create_args args = { |
285 | struct rpc_clnt *clnt; | 285 | .protocol = proto, |
286 | 286 | .address = (struct sockaddr *)srvaddr, | |
287 | xprt = xprt_create_proto(proto, srvaddr, NULL); | 287 | .addrsize = sizeof(*srvaddr), |
288 | if (IS_ERR(xprt)) | 288 | .servername = hostname, |
289 | return (struct rpc_clnt *)xprt; | 289 | .program = &pmap_program, |
290 | xprt->ops->set_port(xprt, RPC_PMAP_PORT); | 290 | .version = RPC_PMAP_VERSION, |
291 | xprt_set_bound(xprt); | 291 | .authflavor = RPC_AUTH_UNIX, |
292 | .flags = (RPC_CLNT_CREATE_ONESHOT | | ||
293 | RPC_CLNT_CREATE_NOPING), | ||
294 | }; | ||
295 | |||
296 | srvaddr->sin_port = htons(RPC_PMAP_PORT); | ||
292 | if (!privileged) | 297 | if (!privileged) |
293 | xprt->resvport = 0; | 298 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; |
294 | 299 | return rpc_create(&args); | |
295 | clnt = rpc_new_client(xprt, hostname, | ||
296 | &pmap_program, RPC_PMAP_VERSION, | ||
297 | RPC_AUTH_UNIX); | ||
298 | if (!IS_ERR(clnt)) { | ||
299 | clnt->cl_softrtry = 1; | ||
300 | clnt->cl_oneshot = 1; | ||
301 | } | ||
302 | return clnt; | ||
303 | } | 300 | } |
304 | 301 | ||
305 | /* | 302 | /* |