summaryrefslogtreecommitdiffstats
path: root/support/export/rmtab.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-06-22 12:43:01 -0400
committerSteve Dickson <steved@redhat.com>2010-06-22 16:04:53 -0400
commit0509d3428f523776ddd9d6e9fa318587d3ec7d84 (patch)
treef8f3cb4d1af6f60bc178800790b666a63c323b61 /support/export/rmtab.c
parent3ca5879be32c4c11750e12230ff588195fff0738 (diff)
downloadnfs-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/export/rmtab.c')
-rw-r--r--support/export/rmtab.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/support/export/rmtab.c b/support/export/rmtab.c
index 0ec495c..31c0f50 100644
--- a/support/export/rmtab.c
+++ b/support/export/rmtab.c
@@ -28,17 +28,14 @@ static void
rmtab_read_wildcard(struct rmtabent *rep)
{
nfs_export *exp, *exp2;
- struct hostent *hp;
+ struct addrinfo *ai;
- hp = gethostbyname(rep->r_client);
- if (hp == NULL)
- return;
- hp = hostent_dup(hp);
- if (hp == NULL)
+ ai = host_addrinfo(rep->r_client);
+ if (ai == NULL)
return;
- exp = export_allowed(hp, rep->r_path);
- free(hp);
+ exp = export_allowed(ai, rep->r_path);
+ freeaddrinfo(ai);
if (exp == NULL)
return;