summaryrefslogtreecommitdiffstats
path: root/configure.ac
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 /configure.ac
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 'configure.ac')
-rw-r--r--configure.ac2
1 files changed, 1 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index c77c5ba..1dc4249 100644
--- a/configure.ac
+++ b/configure.ac
@@ -330,7 +330,7 @@ AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \
gethostbyaddr gethostbyname gethostname getmntent \
- getnameinfo getrpcbyname \
+ getnameinfo getrpcbyname getifaddrs \
gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \
realpath rmdir select socket strcasecmp strchr strdup \
strerror strrchr strtol strtoul sigprocmask])