Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34790
b: refs/heads/master
c: 9e1968c
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Sep 23, 2006
1 parent fc0f1e4 commit f69a571
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae5c79476f36512d1100e162606bb5691f2cce5a
refs/heads/master: 9e1968c58d72c4b85d8a69bda1e194f9701fb224
33 changes: 15 additions & 18 deletions trunk/net/sunrpc/pmap_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,25 +281,22 @@ int rpc_register(u32 prog, u32 vers, int prot, unsigned short port, int *okay)

static struct rpc_clnt *pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto, int privileged)
{
struct rpc_xprt *xprt;
struct rpc_clnt *clnt;

xprt = xprt_create_proto(proto, srvaddr, NULL);
if (IS_ERR(xprt))
return (struct rpc_clnt *)xprt;
xprt->ops->set_port(xprt, RPC_PMAP_PORT);
xprt_set_bound(xprt);
struct rpc_create_args args = {
.protocol = proto,
.address = (struct sockaddr *)srvaddr,
.addrsize = sizeof(*srvaddr),
.servername = hostname,
.program = &pmap_program,
.version = RPC_PMAP_VERSION,
.authflavor = RPC_AUTH_UNIX,
.flags = (RPC_CLNT_CREATE_ONESHOT |
RPC_CLNT_CREATE_NOPING),
};

srvaddr->sin_port = htons(RPC_PMAP_PORT);
if (!privileged)
xprt->resvport = 0;

clnt = rpc_new_client(xprt, hostname,
&pmap_program, RPC_PMAP_VERSION,
RPC_AUTH_UNIX);
if (!IS_ERR(clnt)) {
clnt->cl_softrtry = 1;
clnt->cl_oneshot = 1;
}
return clnt;
args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
return rpc_create(&args);
}

/*
Expand Down

0 comments on commit f69a571

Please sign in to comment.