summaryrefslogtreecommitdiffstats
path: root/support/nfs/rpc_socket.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2009-07-14 16:11:08 -0400
committerSteve Dickson <steved@redhat.com>2009-07-14 16:11:08 -0400
commit2fcfd397bc555a6c31082c09e6fee7750e41fdb0 (patch)
tree0b770b3877f5eb093da207305785e309be04d977 /support/nfs/rpc_socket.c
parent93b7d1f16db674827fc85e70bff1745f57fb6a60 (diff)
downloadnfs-utils-2fcfd397bc555a6c31082c09e6fee7750e41fdb0.tar.gz
nfs-utils-2fcfd397bc555a6c31082c09e6fee7750e41fdb0.tar.xz
nfs-utils-2fcfd397bc555a6c31082c09e6fee7750e41fdb0.zip
getport: Remove AI_ADDRCONFIG from nfs_gp_loopback_address()
AI_ADDRCONFIG was used ostensibly to figure out if the local system had IPv6 available when generating a loopback address. A legacy version of nfs_gp_loopback_address() was created to handle ANYADDR address generation for old versions of glibc where AI_ADDRCONFIG doesn't exist. This means we have to be careful to test both the normal and legacy versions when committing changes in this area. But it turns out that even contemporary versions of glibc ignore AI_ADDRCONFIG when the hostname string is NULL. getaddrinfo(3) always returns an AF_INET and an AF_INET6 loopback address in this case, no matter how the system is configured. Change nfs_gp_loopback_address() to have one version that simply looks up "localhost" instead of doing anything fancy. If "localhost" is an IPv6 address, we'll use that. Otherwise, it should nearly always be an AF_INET loopback address. This eliminates the need for AI_ADDRCONFIG, and removes the duplicate version of nfs_gp_loopback_address(). Note that callers never used the port number in the returned socket address, so get rid of the "sunrpc" service string too. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nfs/rpc_socket.c')
0 files changed, 0 insertions, 0 deletions