diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-09-03 14:35:39 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-09-29 18:13:39 -0400 |
commit | b4ed58fd34d4def88bda59f9cc566ec9fca6a096 (patch) | |
tree | ce377f9ec8773a26e4a967e7d73d42e99d39b0ea /include/linux/lockd/lockd.h | |
parent | 5344b12d4f97d4a9a62d806425977a6ff64b6baf (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 'include/linux/lockd/lockd.h')
-rw-r--r-- | include/linux/lockd/lockd.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 0691efbd0b34..41d7a8e61cea 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -38,7 +38,8 @@ | |||
38 | */ | 38 | */ |
39 | struct nlm_host { | 39 | struct nlm_host { |
40 | struct hlist_node h_hash; /* doubly linked list */ | 40 | struct hlist_node h_hash; /* doubly linked list */ |
41 | struct sockaddr_in h_addr; /* peer address */ | 41 | struct sockaddr_storage h_addr; /* peer address */ |
42 | size_t h_addrlen; | ||
42 | struct sockaddr_in h_saddr; /* our address (optional) */ | 43 | struct sockaddr_in h_saddr; /* our address (optional) */ |
43 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ | 44 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ |
44 | char * h_name; /* remote hostname */ | 45 | char * h_name; /* remote hostname */ |
@@ -77,6 +78,19 @@ struct nsm_handle { | |||
77 | }; | 78 | }; |
78 | 79 | ||
79 | /* | 80 | /* |
81 | * Rigorous type checking on sockaddr type conversions | ||
82 | */ | ||
83 | static inline struct sockaddr_in *nlm_addr_in(const struct nlm_host *host) | ||
84 | { | ||
85 | return (struct sockaddr_in *)&host->h_addr; | ||
86 | } | ||
87 | |||
88 | static inline struct sockaddr *nlm_addr(const struct nlm_host *host) | ||
89 | { | ||
90 | return (struct sockaddr *)&host->h_addr; | ||
91 | } | ||
92 | |||
93 | /* | ||
80 | * Map an fl_owner_t into a unique 32-bit "pid" | 94 | * Map an fl_owner_t into a unique 32-bit "pid" |
81 | */ | 95 | */ |
82 | struct nlm_lockowner { | 96 | struct nlm_lockowner { |