Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79621
b: refs/heads/master
c: 9f6ad26
h: refs/heads/master
i:
  79619: cf0974d
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jan 30, 2008
1 parent 8357466 commit 6a82d46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 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: 510deb0d7035d4fd465627deb3a119ca854f9e00
refs/heads/master: 9f6ad26d2abfd9a2ec4a34b934ca75c4239ab8cf
20 changes: 12 additions & 8 deletions trunk/net/sunrpc/rpcb_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ static void rpcb_wake_rpcbind_waiters(struct rpc_xprt *xprt, int status)
}

static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
int proto, int version, int privileged)
size_t salen, int proto, int version,
int privileged)
{
struct rpc_create_args args = {
.protocol = proto,
.address = srvaddr,
.addrsize = sizeof(struct sockaddr_in),
.addrsize = salen,
.servername = hostname,
.program = &rpcb_program,
.version = version,
Expand Down Expand Up @@ -216,7 +217,7 @@ int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port, int *okay)
prog, vers, prot, port);

rpcb_clnt = rpcb_create("localhost", (struct sockaddr *) &sin,
XPRT_TRANSPORT_UDP, 2, 1);
sizeof(sin), XPRT_TRANSPORT_UDP, 2, 1);
if (IS_ERR(rpcb_clnt))
return PTR_ERR(rpcb_clnt);

Expand Down Expand Up @@ -265,7 +266,8 @@ int rpcb_getport_sync(struct sockaddr_in *sin, __u32 prog,
__FUNCTION__, NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot);

sprintf(hostname, NIPQUAD_FMT, NIPQUAD(sin->sin_addr.s_addr));
rpcb_clnt = rpcb_create(hostname, (struct sockaddr *)sin, prot, 2, 0);
rpcb_clnt = rpcb_create(hostname, (struct sockaddr *)sin,
sizeof(sin), prot, 2, 0);
if (IS_ERR(rpcb_clnt))
return PTR_ERR(rpcb_clnt);

Expand Down Expand Up @@ -314,7 +316,9 @@ void rpcb_getport_async(struct rpc_task *task)
struct rpc_clnt *rpcb_clnt;
static struct rpcbind_args *map;
struct rpc_task *child;
struct sockaddr addr;
struct sockaddr_storage addr;
struct sockaddr *sap = (struct sockaddr *)&addr;
size_t salen;
int status;
struct rpcb_info *info;

Expand Down Expand Up @@ -344,10 +348,10 @@ void rpcb_getport_async(struct rpc_task *task)
goto bailout_nofree;
}

rpc_peeraddr(clnt, (void *)&addr, sizeof(addr));
salen = rpc_peeraddr(clnt, sap, sizeof(addr));

/* Don't ever use rpcbind v2 for AF_INET6 requests */
switch (addr.sa_family) {
switch (sap->sa_family) {
case AF_INET:
info = rpcb_next_version;
break;
Expand All @@ -372,7 +376,7 @@ void rpcb_getport_async(struct rpc_task *task)
dprintk("RPC: %5u %s: trying rpcbind version %u\n",
task->tk_pid, __FUNCTION__, bind_version);

rpcb_clnt = rpcb_create(clnt->cl_server, &addr, xprt->prot,
rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
bind_version, 0);
if (IS_ERR(rpcb_clnt)) {
status = PTR_ERR(rpcb_clnt);
Expand Down

0 comments on commit 6a82d46

Please sign in to comment.