mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
SUNRPC: Simplify synopsis of rpcb_local_clnt()
Clean up: At one point, rpcb_local_clnt() handled IPv6 loopback addresses too, but it doesn't any more; only IPv4 loopback is used now. Get rid of the @addr and @addrlen arguments to rpcb_local_clnt(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
09a21c4102
commit
5a46211540
1 changed files with 4 additions and 7 deletions
|
@ -163,13 +163,12 @@ static const struct sockaddr_in rpcb_inaddr_loopback = {
|
||||||
.sin_port = htons(RPCBIND_PORT),
|
.sin_port = htons(RPCBIND_PORT),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct rpc_clnt *rpcb_create_local(struct sockaddr *addr,
|
static struct rpc_clnt *rpcb_create_local(u32 version)
|
||||||
size_t addrlen, u32 version)
|
|
||||||
{
|
{
|
||||||
struct rpc_create_args args = {
|
struct rpc_create_args args = {
|
||||||
.protocol = XPRT_TRANSPORT_UDP,
|
.protocol = XPRT_TRANSPORT_UDP,
|
||||||
.address = addr,
|
.address = (struct sockaddr *)&rpcb_inaddr_loopback,
|
||||||
.addrsize = addrlen,
|
.addrsize = sizeof(rpcb_inaddr_loopback),
|
||||||
.servername = "localhost",
|
.servername = "localhost",
|
||||||
.program = &rpcb_program,
|
.program = &rpcb_program,
|
||||||
.version = version,
|
.version = version,
|
||||||
|
@ -211,14 +210,12 @@ static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
|
||||||
|
|
||||||
static int rpcb_register_call(const u32 version, struct rpc_message *msg)
|
static int rpcb_register_call(const u32 version, struct rpc_message *msg)
|
||||||
{
|
{
|
||||||
struct sockaddr *addr = (struct sockaddr *)&rpcb_inaddr_loopback;
|
|
||||||
size_t addrlen = sizeof(rpcb_inaddr_loopback);
|
|
||||||
struct rpc_clnt *rpcb_clnt;
|
struct rpc_clnt *rpcb_clnt;
|
||||||
int result, error = 0;
|
int result, error = 0;
|
||||||
|
|
||||||
msg->rpc_resp = &result;
|
msg->rpc_resp = &result;
|
||||||
|
|
||||||
rpcb_clnt = rpcb_create_local(addr, addrlen, version);
|
rpcb_clnt = rpcb_create_local(version);
|
||||||
if (!IS_ERR(rpcb_clnt)) {
|
if (!IS_ERR(rpcb_clnt)) {
|
||||||
error = rpc_call_sync(rpcb_clnt, msg, 0);
|
error = rpc_call_sync(rpcb_clnt, msg, 0);
|
||||||
rpc_shutdown_client(rpcb_clnt);
|
rpc_shutdown_client(rpcb_clnt);
|
||||||
|
|
Loading…
Reference in a new issue