summaryrefslogtreecommitdiffstats
path: root/aclocal
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-01-15 15:53:07 -0500
committerSteve Dickson <steved@redhat.com>2010-01-17 16:45:12 -0500
commit4bc0dbaed1ba2f58beea2cdb0595b461e0c88b8e (patch)
treeb618147519a75390227a370f95c2d4de2e0daf41 /aclocal
parente8c917f53741100d6ea710100dca7c914791880b (diff)
downloadnfs-utils-4bc0dbaed1ba2f58beea2cdb0595b461e0c88b8e.tar.gz
nfs-utils-4bc0dbaed1ba2f58beea2cdb0595b461e0c88b8e.tar.xz
nfs-utils-4bc0dbaed1ba2f58beea2cdb0595b461e0c88b8e.zip
tcp_wrappers: Use getifaddrs(3) if it is available
After glibc 2.3.3, getifaddrs(3) can return AF_INET6 addresses for local network interfaces. Using the library call is easier than trying to update the open code in from_local(), and means we have less to maintain in nfs-utils going forward. And, since from_local() can now support IPv6, change its synopsis to take a "struct sockaddr *" . Note that the original code discovers local addresses once. These days, with wifi, DHCP, and NetworkManager, the local network configuration can change dynamically over time. So, call getifaddrs() more often to ensure from_local() has up-to-date network configuration information. This implementation refreshes the list if from_local() has not been called in the last second. This is actually not terribly honerous. check_default() invokes from_local() only when the remote host is not in its access cache, or the access/deny files have changed. So new hosts will cause a refresh, but previously seen hosts (including localhost) should not. On the other hand, it still may not be often enough. After the first call, if only previously seen hosts attempt to access our daemons, from_local() would never be called, and the local list would never be updated. This might be possible during steady-state operation with a small number of servers and clients. It would also be nice if we could free the local interface address list at shutdown time, but that would be a lot of trouble for little gain. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'aclocal')
-rw-r--r--aclocal/ipv6.m44
1 files changed, 2 insertions, 2 deletions
diff --git a/aclocal/ipv6.m4 b/aclocal/ipv6.m4
index 2490f3d..5ee8fb6 100644
--- a/aclocal/ipv6.m4
+++ b/aclocal/ipv6.m4
@@ -15,8 +15,8 @@ AC_DEFUN([AC_IPV6], [
fi
dnl IPv6-enabled networking functions required for IPv6
- AC_CHECK_FUNCS([getnameinfo bindresvport_sa], ,
- [AC_MSG_ERROR([Missing functions needed for IPv6.])])
+ AC_CHECK_FUNCS([getifaddrs getnameinfo bindresvport_sa], ,
+ [AC_MSG_ERROR([Missing library functions needed for IPv6.])])
dnl Need to detect presence of IPv6 networking at run time via
dnl getaddrinfo(3); old versions of glibc do not support ADDRCONFIG