Commit b91e101f authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

SUNRPC: rpcb_getport_sync() should use built-in hostname generator

rpc_create() can already fill in the hostname with a string representation
of the server's IP address, so remove redundant logic in in
rpcb_getport_sync() that does that.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 33e01dc7
...@@ -220,14 +220,12 @@ int rpcb_getport_sync(struct sockaddr_in *sin, __u32 prog, ...@@ -220,14 +220,12 @@ int rpcb_getport_sync(struct sockaddr_in *sin, __u32 prog,
.rpc_resp = &map.r_port, .rpc_resp = &map.r_port,
}; };
struct rpc_clnt *rpcb_clnt; struct rpc_clnt *rpcb_clnt;
char hostname[40];
int status; int status;
dprintk("RPC: %s(" NIPQUAD_FMT ", %u, %u, %d)\n", dprintk("RPC: %s(" NIPQUAD_FMT ", %u, %u, %d)\n",
__FUNCTION__, NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot); __FUNCTION__, NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot);
sprintf(hostname, NIPQUAD_FMT, NIPQUAD(sin->sin_addr.s_addr)); rpcb_clnt = rpcb_create(NULL, (struct sockaddr *)sin,
rpcb_clnt = rpcb_create(hostname, (struct sockaddr *)sin,
sizeof(sin), prot, 2, 0); sizeof(sin), prot, 2, 0);
if (IS_ERR(rpcb_clnt)) if (IS_ERR(rpcb_clnt))
return PTR_ERR(rpcb_clnt); return PTR_ERR(rpcb_clnt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment