*/
chain = &nlm_hosts[hash];
hlist_for_each_entry(host, pos, chain, h_hash) {
- if (!nlm_cmp_addr(&host->h_addr, sin))
+ if (!nlm_cmp_addr(nlm_addr(host), (struct sockaddr *)sin))
continue;
/* See if we have an NSM handle for this client */
continue;
if (host->h_server != server)
continue;
- if (!nlm_cmp_addr(&host->h_saddr, ssin))
+ if (!nlm_cmp_addr(nlm_srcaddr(host), (struct sockaddr *)ssin))
continue;
/* Move to head of hash chain. */
goto out;
}
host->h_name = nsm->sm_name;
- host->h_addr = *sin;
- nlm_clear_port((struct sockaddr *)&host->h_addr);
- host->h_saddr = *ssin;
+ memcpy(nlm_addr(host), sin, sizeof(*sin));
+ host->h_addrlen = sizeof(*sin);
+ nlm_clear_port(nlm_addr(host));
+ memcpy(nlm_srcaddr(host), ssin, sizeof(*ssin));
host->h_version = version;
host->h_proto = proto;
host->h_rpcclnt = NULL;
nlm_display_address((struct sockaddr *)&host->h_addr,
host->h_addrbuf, sizeof(host->h_addrbuf));
- nlm_display_address((struct sockaddr *)&host->h_saddr,
- host->h_saddrbuf, sizeof(host->h_saddrbuf));
+ nlm_display_address((struct sockaddr *)&host->h_srcaddr,
+ host->h_srcaddrbuf, sizeof(host->h_srcaddrbuf));
dprintk("lockd: nlm_lookup_host created host %s\n",
host->h_name);
struct rpc_clnt *clnt;
dprintk("lockd: nlm_bind_host %s (%s), my addr=%s\n",
- host->h_name, host->h_addrbuf, host->h_saddrbuf);
+ host->h_name, host->h_addrbuf, host->h_srcaddrbuf);
/* Lock host handle */
mutex_lock(&host->h_mutex);
};
struct rpc_create_args args = {
.protocol = host->h_proto,
- .address = (struct sockaddr *)&host->h_addr,
- .addrsize = sizeof(host->h_addr),
- .saddress = (struct sockaddr *)&host->h_saddr,
+ .address = nlm_addr(host),
+ .addrsize = host->h_addrlen,
+ .saddress = nlm_srcaddr(host),
.timeout = &timeparms,
.servername = host->h_name,
.program = &nlm_program,
if (strlen(pos->sm_name) != hostname_len
|| memcmp(pos->sm_name, hostname, hostname_len))
continue;
- } else if (!nlm_cmp_addr(&pos->sm_addr, sin))
+ } else if (!nlm_cmp_addr(nsm_addr(pos), (struct sockaddr *)sin))
continue;
atomic_inc(&pos->sm_count);
kfree(nsm);
if (nsm == NULL)
return NULL;
- nsm->sm_addr = *sin;
+ memcpy(nsm_addr(nsm), sin, sizeof(*sin));
+ nsm->sm_addrlen = sizeof(*sin);
nsm->sm_name = (char *) (nsm + 1);
memcpy(nsm->sm_name, hostname, hostname_len);
nsm->sm_name[hostname_len] = '\0';