aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/host.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-09-03 14:35:39 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-09-29 18:13:39 -0400
commitb4ed58fd34d4def88bda59f9cc566ec9fca6a096 (patch)
treece377f9ec8773a26e4a967e7d73d42e99d39b0ea /fs/lockd/host.c
parent5344b12d4f97d4a9a62d806425977a6ff64b6baf (diff)
lockd: Use sockaddr_storage + length for h_addr field
To store larger addresses in the nlm_host structure, make h_addr a sockaddr_storage, and add an address length field. 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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 008e4026f540..8c7022eeae65 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -116,7 +116,7 @@ static struct nlm_host *nlm_lookup_host(int server,
116 */ 116 */
117 chain = &nlm_hosts[hash]; 117 chain = &nlm_hosts[hash];
118 hlist_for_each_entry(host, pos, chain, h_hash) { 118 hlist_for_each_entry(host, pos, chain, h_hash) {
119 if (!nlm_cmp_addr(&host->h_addr, sin)) 119 if (!nlm_cmp_addr(nlm_addr_in(host), sin))
120 continue; 120 continue;
121 121
122 /* See if we have an NSM handle for this client */ 122 /* See if we have an NSM handle for this client */
@@ -165,8 +165,9 @@ static struct nlm_host *nlm_lookup_host(int server,
165 goto out; 165 goto out;
166 } 166 }
167 host->h_name = nsm->sm_name; 167 host->h_name = nsm->sm_name;
168 host->h_addr = *sin; 168 memcpy(nlm_addr(host), sin, sizeof(*sin));
169 nlm_clear_port((struct sockaddr *)&host->h_addr); 169 host->h_addrlen = sizeof(*sin);
170 nlm_clear_port(nlm_addr(host));
170 host->h_saddr = *ssin; 171 host->h_saddr = *ssin;
171 host->h_version = version; 172 host->h_version = version;
172 host->h_proto = proto; 173 host->h_proto = proto;
@@ -291,8 +292,8 @@ nlm_bind_host(struct nlm_host *host)
291 }; 292 };
292 struct rpc_create_args args = { 293 struct rpc_create_args args = {
293 .protocol = host->h_proto, 294 .protocol = host->h_proto,
294 .address = (struct sockaddr *)&host->h_addr, 295 .address = nlm_addr(host),
295 .addrsize = sizeof(host->h_addr), 296 .addrsize = host->h_addrlen,
296 .saddress = (struct sockaddr *)&host->h_saddr, 297 .saddress = (struct sockaddr *)&host->h_saddr,
297 .timeout = &timeparms, 298 .timeout = &timeparms,
298 .servername = host->h_name, 299 .servername = host->h_name,