Skip to content

Commit

Permalink
Assume non-buggy getaddrinfo() when cross-compiling.
Browse files Browse the repository at this point in the history
The cross target is probably some flavor of Linux (this includes
Android) or *BSD (or maybe iOS if you're building for a jailbroken
system), and those should have non-buggy getaddrinfo().

If somebody's cross-compiling for a target with a buggy getaddrinfo(),
and tcpdump incorrectly converting IPv6 addresses to host names causes
the universe to collapse into a giant black hole or something equally
horrible, too bad.

Expand a comment while we're at it.
  • Loading branch information
guyharris committed Dec 19, 2014
1 parent 56e2d8c commit 4998bba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -4541,6 +4541,9 @@ fi
# All of the ones we check for must be available in order to enable
# capsicum sandboxing.
#
# XXX - do we need to check for all of them, or are there some that, if
# present, imply others are present?
#
if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then
for ac_func in cap_enter cap_rights_limit cap_ioctls_limit openat
do :
Expand Down Expand Up @@ -5115,7 +5118,7 @@ $as_echo_n "checking getaddrinfo bug... " >&6; }
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
td_cv_buggygetaddrinfo=yes
td_cv_buggygetaddrinfo=unknown
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
Expand Down Expand Up @@ -5229,6 +5232,9 @@ fi
if test "$td_cv_buggygetaddrinfo" = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: good" >&5
$as_echo "good" >&6; }
elif test "$td_cv_buggygetaddrinfo" = unknown; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown (cross-compiling)" >&5
$as_echo "unknown (cross-compiling)" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy" >&5
$as_echo "buggy" >&6; }
Expand Down
7 changes: 6 additions & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ AC_ARG_WITH(sandbox-capsicum,
# All of the ones we check for must be available in order to enable
# capsicum sandboxing.
#
# XXX - do we need to check for all of them, or are there some that, if
# present, imply others are present?
#
if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then
AC_CHECK_FUNCS(cap_enter cap_rights_limit cap_ioctls_limit openat,
ac_lbl_capsicum_function_seen=yes,
Expand Down Expand Up @@ -502,9 +505,11 @@ main()
],
td_cv_buggygetaddrinfo=no,
td_cv_buggygetaddrinfo=yes,
td_cv_buggygetaddrinfo=yes)])
td_cv_buggygetaddrinfo=unknown)])
if test "$td_cv_buggygetaddrinfo" = no; then
AC_MSG_RESULT(good)
elif test "$td_cv_buggygetaddrinfo" = unknown; then
AC_MSG_RESULT([unknown (cross-compiling)])
else
AC_MSG_RESULT(buggy)
fi
Expand Down

0 comments on commit 4998bba

Please sign in to comment.