diff options
Diffstat (limited to 'net/sunrpc/rpcb_clnt.c')
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 830faf4d9997..28f50da60ceb 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -163,13 +163,12 @@ static const struct sockaddr_in rpcb_inaddr_loopback = { | |||
163 | .sin_port = htons(RPCBIND_PORT), | 163 | .sin_port = htons(RPCBIND_PORT), |
164 | }; | 164 | }; |
165 | 165 | ||
166 | static struct rpc_clnt *rpcb_create_local(struct sockaddr *addr, | 166 | static struct rpc_clnt *rpcb_create_local(u32 version) |
167 | size_t addrlen, u32 version) | ||
168 | { | 167 | { |
169 | struct rpc_create_args args = { | 168 | struct rpc_create_args args = { |
170 | .protocol = XPRT_TRANSPORT_UDP, | 169 | .protocol = XPRT_TRANSPORT_UDP, |
171 | .address = addr, | 170 | .address = (struct sockaddr *)&rpcb_inaddr_loopback, |
172 | .addrsize = addrlen, | 171 | .addrsize = sizeof(rpcb_inaddr_loopback), |
173 | .servername = "localhost", | 172 | .servername = "localhost", |
174 | .program = &rpcb_program, | 173 | .program = &rpcb_program, |
175 | .version = version, | 174 | .version = version, |
@@ -211,14 +210,12 @@ static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr, | |||
211 | 210 | ||
212 | static int rpcb_register_call(const u32 version, struct rpc_message *msg) | 211 | static int rpcb_register_call(const u32 version, struct rpc_message *msg) |
213 | { | 212 | { |
214 | struct sockaddr *addr = (struct sockaddr *)&rpcb_inaddr_loopback; | ||
215 | size_t addrlen = sizeof(rpcb_inaddr_loopback); | ||
216 | struct rpc_clnt *rpcb_clnt; | 213 | struct rpc_clnt *rpcb_clnt; |
217 | int result, error = 0; | 214 | int result, error = 0; |
218 | 215 | ||
219 | msg->rpc_resp = &result; | 216 | msg->rpc_resp = &result; |
220 | 217 | ||
221 | rpcb_clnt = rpcb_create_local(addr, addrlen, version); | 218 | rpcb_clnt = rpcb_create_local(version); |
222 | if (!IS_ERR(rpcb_clnt)) { | 219 | if (!IS_ERR(rpcb_clnt)) { |
223 | error = rpc_call_sync(rpcb_clnt, msg, 0); | 220 | error = rpc_call_sync(rpcb_clnt, msg, 0); |
224 | rpc_shutdown_client(rpcb_clnt); | 221 | rpc_shutdown_client(rpcb_clnt); |