Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114323
b: refs/heads/master
c: 90151e6
h: refs/heads/master
i:
  114321: a9690fe
  114319: 3a92718
v: v3
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Sep 29, 2008
1 parent 7c09e78 commit db354ef
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4ed58fd34d4def88bda59f9cc566ec9fca6a096
refs/heads/master: 90151e6e4d00a3150d03d52170c246734b274622
12 changes: 6 additions & 6 deletions trunk/fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static struct nlm_host *nlm_lookup_host(int server,
continue;
if (host->h_server != server)
continue;
if (!nlm_cmp_addr(&host->h_saddr, ssin))
if (!nlm_cmp_addr(nlm_srcaddr_in(host), ssin))
continue;

/* Move to head of hash chain. */
Expand Down Expand Up @@ -168,7 +168,7 @@ static struct nlm_host *nlm_lookup_host(int server,
memcpy(nlm_addr(host), sin, sizeof(*sin));
host->h_addrlen = sizeof(*sin);
nlm_clear_port(nlm_addr(host));
host->h_saddr = *ssin;
memcpy(nlm_srcaddr(host), ssin, sizeof(*ssin));
host->h_version = version;
host->h_proto = proto;
host->h_rpcclnt = NULL;
Expand All @@ -192,8 +192,8 @@ static struct nlm_host *nlm_lookup_host(int server,

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);
Expand Down Expand Up @@ -267,7 +267,7 @@ nlm_bind_host(struct nlm_host *host)
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);
Expand All @@ -294,7 +294,7 @@ nlm_bind_host(struct nlm_host *host)
.protocol = host->h_proto,
.address = nlm_addr(host),
.addrsize = host->h_addrlen,
.saddress = (struct sockaddr *)&host->h_saddr,
.saddress = nlm_srcaddr(host),
.timeout = &timeparms,
.servername = host->h_name,
.program = &nlm_program,
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/lockd/svcsubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ EXPORT_SYMBOL_GPL(nlmsvc_unlock_all_by_sb);
static int
nlmsvc_match_ip(void *datap, struct nlm_host *host)
{
return nlm_cmp_addr(&host->h_saddr, datap);
return nlm_cmp_addr(nlm_srcaddr_in(host), datap);
}

/**
Expand Down
14 changes: 12 additions & 2 deletions trunk/include/linux/lockd/lockd.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct nlm_host {
struct hlist_node h_hash; /* doubly linked list */
struct sockaddr_storage h_addr; /* peer address */
size_t h_addrlen;
struct sockaddr_in h_saddr; /* our address (optional) */
struct sockaddr_storage h_srcaddr; /* our address (optional) */
struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */
char * h_name; /* remote hostname */
u32 h_version; /* interface version */
Expand All @@ -64,7 +64,7 @@ struct nlm_host {
struct nsm_handle * h_nsmhandle; /* NSM status handle */

char h_addrbuf[48], /* address eyecatchers */
h_saddrbuf[48];
h_srcaddrbuf[48];
};

struct nsm_handle {
Expand All @@ -90,6 +90,16 @@ static inline struct sockaddr *nlm_addr(const struct nlm_host *host)
return (struct sockaddr *)&host->h_addr;
}

static inline struct sockaddr_in *nlm_srcaddr_in(const struct nlm_host *host)
{
return (struct sockaddr_in *)&host->h_srcaddr;
}

static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host)
{
return (struct sockaddr *)&host->h_srcaddr;
}

/*
* Map an fl_owner_t into a unique 32-bit "pid"
*/
Expand Down

0 comments on commit db354ef

Please sign in to comment.