aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2023-01-14 03:21:06 -0800
committerDenis Ovsienko <denis@ovsienko.info>2024-04-24 17:41:51 +0100
commit758101e5d16d3318b27a6ed06cec6cc29a4dbd2b (patch)
tree22c41ea8fcefc72aaf2cdfd74552d34aa69764b8
parent0bdde63b5925c4edc417b07b8fc379ac46e3eeb9 (diff)
downloadtcpdump-758101e5d16d3318b27a6ed06cec6cc29a4dbd2b.tar.gz
configure: check for gethostbyaddr(), not gethostbyname().
We use gethostbyaddr() to translate IP addresses in packets to names; we don't use gethostbyname() to translate names to IP addresses (libpcap does the latter when compiling filters, so we leave that up to it, and nothing's left for us to do). This probably has the same effect as checking for gethostbyname(), but it makes it a bit clearer why we'd check for it. (cherry picked from commit b1ccc20ccc9bdd73ed065db61ab9cb5b74e5acb4)
-rw-r--r--aclocal.m412
1 files changed, 6 insertions, 6 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 65a4a9e6..ba0960e6 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1045,11 +1045,11 @@ dnl
dnl AC_LBL_LIBRARY_NET
dnl
dnl This test is for network applications that need socket() and
-dnl gethostbyname() -ish functions. Under Solaris, those applications
+dnl gethostbyaddr() -ish functions. Under Solaris, those applications
dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link
dnl with "-lnsl" but should *not* link with "-lsocket" because
dnl libsocket.a breaks a number of things (for instance:
-dnl gethostbyname() under IRIX 5.2, and snoop sockets under most
+dnl gethostbyaddr() under IRIX 5.2, and snoop sockets under most
dnl versions of IRIX).
dnl
dnl Unfortunately, many application developers are not aware of this,
@@ -1077,16 +1077,16 @@ dnl statically and happen to have a libresolv.a lying around (and no
dnl libnsl.a).
dnl
AC_DEFUN(AC_LBL_LIBRARY_NET, [
- # Most operating systems have gethostbyname() in the default searched
+ # Most operating systems have gethostbyaddr() in the default searched
# libraries (i.e. libc):
# Some OSes (eg. Solaris) place it in libnsl
# Some strange OSes (SINIX) have it in libsocket:
- AC_SEARCH_LIBS(gethostbyname, nsl socket resolv)
+ AC_SEARCH_LIBS(gethostbyaddr, nsl socket resolv)
# Unfortunately libsocket sometimes depends on libnsl and
# AC_SEARCH_LIBS isn't up to the task of handling dependencies like this.
- if test "$ac_cv_search_gethostbyname" = "no"
+ if test "$ac_cv_search_gethostbyaddr" = "no"
then
- AC_CHECK_LIB(socket, gethostbyname,
+ AC_CHECK_LIB(socket, gethostbyaddr,
LIBS="-lsocket -lnsl $LIBS", , -lnsl)
fi
AC_SEARCH_LIBS(socket, socket, ,