From 4998bba23c915829872563e483f83552b1ae8dcd Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 19 Dec 2014 13:44:21 -0800 Subject: [PATCH] Assume non-buggy getaddrinfo() when cross-compiling. 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. --- configure | 8 +++++++- configure.in | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/configure b/configure index f352e540b..9be5b096b 100755 --- a/configure +++ b/configure @@ -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 : @@ -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. */ @@ -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; } diff --git a/configure.in b/configure.in index 15fe9bbeb..53abfcf40 100644 --- a/configure.in +++ b/configure.in @@ -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, @@ -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