diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-08-27 16:57:31 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-09-29 18:13:38 -0400 |
commit | 2860a0227b700feb8d6e5c4f07a62a1b40d96022 (patch) | |
tree | a0a83210999107a33f5b55ac211299a2f3e034f9 /fs/lockd/host.c | |
parent | 1b333c54a15a746ff6b04a684b0845a66daacef2 (diff) | |
download | lwn-2860a0227b700feb8d6e5c4f07a62a1b40d96022.tar.gz lwn-2860a0227b700feb8d6e5c4f07a62a1b40d96022.zip |
lockd: Specify address family for source address
Make sure an address family is specified for source addresses passed to
nlm_lookup_host(). nlm_lookup_host() will need this when it becomes
capable of dealing with AF_INET6 addresses.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r-- | fs/lockd/host.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index e5dcfa57e099..22423abea281 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -220,10 +220,12 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr_in *sin, const char *hostname, unsigned int hostname_len) { - struct sockaddr_in ssin = {0}; + const struct sockaddr_in source = { + .sin_family = AF_UNSPEC, + }; return nlm_lookup_host(0, sin, proto, version, - hostname, hostname_len, &ssin); + hostname, hostname_len, &source); } /* @@ -233,12 +235,14 @@ struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *rqstp, const char *hostname, unsigned int hostname_len) { - struct sockaddr_in ssin = {0}; + const struct sockaddr_in source = { + .sin_family = AF_INET, + .sin_addr = rqstp->rq_daddr.addr, + }; - ssin.sin_addr = rqstp->rq_daddr.addr; return nlm_lookup_host(1, svc_addr_in(rqstp), rqstp->rq_prot, rqstp->rq_vers, - hostname, hostname_len, &ssin); + hostname, hostname_len, &source); } /* |