diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2010-06-22 12:43:01 -0400 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2010-06-22 16:04:53 -0400 |
| commit | 0509d3428f523776ddd9d6e9fa318587d3ec7d84 (patch) | |
| tree | f8f3cb4d1af6f60bc178800790b666a63c323b61 /support/include | |
| parent | 3ca5879be32c4c11750e12230ff588195fff0738 (diff) | |
| download | nfs-utils-0509d3428f523776ddd9d6e9fa318587d3ec7d84.tar.gz nfs-utils-0509d3428f523776ddd9d6e9fa318587d3ec7d84.tar.xz nfs-utils-0509d3428f523776ddd9d6e9fa318587d3ec7d84.zip | |
mountd: Replace "struct hostent" with "struct addrinfo"
struct hostent can store either IPv4 or IPv6 addresses, but it can't
store both address families concurrently for the same host. Neither
can hostent deal with parts of socket addresses that are outside of
the sin{,6}_addr field.
Replace the use of "struct hostent" everywhere in libexport.a, mountd,
and exportfs with "struct addrinfo". This is a large change, but
there are so many strong dependencies on struct hostent that this
can't easily be broken into smaller pieces.
One benefit of this change is that hostent_dup() is no longer
required, since the results of getaddrinfo(3) are already dynamically
allocated.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/include')
| -rw-r--r-- | support/include/exportfs.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/support/include/exportfs.h b/support/include/exportfs.h index 97bb68e..0da8566 100644 --- a/support/include/exportfs.h +++ b/support/include/exportfs.h @@ -116,13 +116,15 @@ extern exp_hash_table exportlist[MCL_MAXTYPES]; extern nfs_client * clientlist[MCL_MAXTYPES]; nfs_client * client_lookup(char *hname, int canonical); -nfs_client * client_dup(nfs_client *, struct hostent *); +nfs_client * client_dup(const nfs_client *clp, + const struct addrinfo *ai); int client_gettype(char *hname); -int client_check(nfs_client *, struct hostent *); +int client_check(const nfs_client *clp, + const struct addrinfo *ai); void client_release(nfs_client *); void client_freeall(void); -char * client_compose(struct hostent *he); -struct hostent * client_resolve(struct in_addr addr); +char * client_compose(const struct addrinfo *ai); +struct addrinfo * client_resolve(const struct sockaddr *sap); int client_member(const char *client, const char *name); @@ -130,10 +132,11 @@ int export_read(char *fname); void export_add(nfs_export *); void export_reset(nfs_export *); nfs_export * export_lookup(char *hname, char *path, int caconical); -nfs_export * export_find(struct hostent *, char *path); -nfs_export * export_allowed(struct hostent *, char *path); +nfs_export * export_find(const struct addrinfo *ai, + const char *path); +nfs_export * export_allowed(const struct addrinfo *ai, + const char *path); nfs_export * export_create(struct exportent *, int canonical); -nfs_export * export_dup(nfs_export *, struct hostent *); void export_freeall(void); int export_export(nfs_export *); int export_unexport(nfs_export *); |
