diff options
Diffstat (limited to 'fs/lockd/host.c')
| -rw-r--r-- | fs/lockd/host.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 25e21e4023b2..ed0c59fe23ce 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
| @@ -124,7 +124,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) | |||
| 124 | continue; | 124 | continue; |
| 125 | if (host->h_server != ni->server) | 125 | if (host->h_server != ni->server) |
| 126 | continue; | 126 | continue; |
| 127 | if (ni->server && | 127 | if (ni->server && ni->src_len != 0 && |
| 128 | !rpc_cmp_addr(nlm_srcaddr(host), ni->src_sap)) | 128 | !rpc_cmp_addr(nlm_srcaddr(host), ni->src_sap)) |
| 129 | continue; | 129 | continue; |
| 130 | 130 | ||
| @@ -167,6 +167,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) | |||
| 167 | host->h_addrlen = ni->salen; | 167 | host->h_addrlen = ni->salen; |
| 168 | rpc_set_port(nlm_addr(host), 0); | 168 | rpc_set_port(nlm_addr(host), 0); |
| 169 | memcpy(nlm_srcaddr(host), ni->src_sap, ni->src_len); | 169 | memcpy(nlm_srcaddr(host), ni->src_sap, ni->src_len); |
| 170 | host->h_srcaddrlen = ni->src_len; | ||
| 170 | host->h_version = ni->version; | 171 | host->h_version = ni->version; |
| 171 | host->h_proto = ni->protocol; | 172 | host->h_proto = ni->protocol; |
| 172 | host->h_rpcclnt = NULL; | 173 | host->h_rpcclnt = NULL; |
| @@ -238,9 +239,6 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, | |||
| 238 | const char *hostname, | 239 | const char *hostname, |
| 239 | int noresvport) | 240 | int noresvport) |
| 240 | { | 241 | { |
| 241 | const struct sockaddr source = { | ||
| 242 | .sa_family = AF_UNSPEC, | ||
| 243 | }; | ||
| 244 | struct nlm_lookup_host_info ni = { | 242 | struct nlm_lookup_host_info ni = { |
| 245 | .server = 0, | 243 | .server = 0, |
| 246 | .sap = sap, | 244 | .sap = sap, |
| @@ -249,8 +247,6 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, | |||
| 249 | .version = version, | 247 | .version = version, |
| 250 | .hostname = hostname, | 248 | .hostname = hostname, |
| 251 | .hostname_len = strlen(hostname), | 249 | .hostname_len = strlen(hostname), |
| 252 | .src_sap = &source, | ||
| 253 | .src_len = sizeof(source), | ||
| 254 | .noresvport = noresvport, | 250 | .noresvport = noresvport, |
| 255 | }; | 251 | }; |
| 256 | 252 | ||
| @@ -357,7 +353,6 @@ nlm_bind_host(struct nlm_host *host) | |||
| 357 | .protocol = host->h_proto, | 353 | .protocol = host->h_proto, |
| 358 | .address = nlm_addr(host), | 354 | .address = nlm_addr(host), |
| 359 | .addrsize = host->h_addrlen, | 355 | .addrsize = host->h_addrlen, |
| 360 | .saddress = nlm_srcaddr(host), | ||
| 361 | .timeout = &timeparms, | 356 | .timeout = &timeparms, |
| 362 | .servername = host->h_name, | 357 | .servername = host->h_name, |
| 363 | .program = &nlm_program, | 358 | .program = &nlm_program, |
| @@ -376,6 +371,8 @@ nlm_bind_host(struct nlm_host *host) | |||
| 376 | args.flags |= RPC_CLNT_CREATE_HARDRTRY; | 371 | args.flags |= RPC_CLNT_CREATE_HARDRTRY; |
| 377 | if (host->h_noresvport) | 372 | if (host->h_noresvport) |
| 378 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; | 373 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; |
| 374 | if (host->h_srcaddrlen) | ||
| 375 | args.saddress = nlm_srcaddr(host); | ||
| 379 | 376 | ||
| 380 | clnt = rpc_create(&args); | 377 | clnt = rpc_create(&args); |
| 381 | if (!IS_ERR(clnt)) | 378 | if (!IS_ERR(clnt)) |
