summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2021-10-12 16:26:35 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2021-10-12 16:26:35 +0000
commit78eb61a2b8f1fdef480f2a595887e3238d170194 (patch)
tree17414b62d34d37987a5a8446e009d866d791d42e
parente6f5858d84dafc074385121edf9ed8beaf7ca0fa (diff)
downloadlibapr-78eb61a2b8f1fdef480f2a595887e3238d170194.tar.gz
Merge r1894167 from trunk:
Since runtime SCTP detection is dependent on kernel configuration, add flags to make SCTP support reliable: * build/apr_network.m4 (APR_CHECK_SCTP): Add --disable-sctp flag to forcibly disable SCTP support, and --enable-sctp to fail configure if is SCTP support is requested but not available. Submitted by: Lubos Uhliarik <luhliari redhat.com>, jorton Github: closes #28 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1894170 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES4
-rw-r--r--build/apr_network.m417
2 files changed, 19 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 184877ba9..7b5f3860d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,10 @@ Changes for APR 1.7.1
(This issue was addressed as CVE-2017-12613 in APR 1.6.3 and
later 1.6.x releases, but was missing in 1.7.0.) [Stefan Sperling]
+ *) configure: Add --disable-sctp argument to forcibly disable SCTP
+ support, or --enable-sctp which fails if SCTP support is not
+ detected. [Lubos Uhliarik <luhliari redhat.com>, Joe Orton]
+
*) Fix handle leak in the Win32 apr_uid_current implementation.
PR 61165. [Ivan Zhakov]
diff --git a/build/apr_network.m4 b/build/apr_network.m4
index 6918efcc3..21e9ce7e6 100644
--- a/build/apr_network.m4
+++ b/build/apr_network.m4
@@ -906,8 +906,16 @@ dnl check for presence of SCTP protocol support
dnl
AC_DEFUN([APR_CHECK_SCTP],
[
- AC_CACHE_CHECK([whether SCTP is supported], [apr_cv_sctp], [
- AC_TRY_RUN([
+AC_ARG_ENABLE([sctp],
+ APR_HELP_STRING([--disable-sctp], [disable SCTP protocol support]),
+ [apr_wants_sctp=$enableval],
+ [apr_wants_sctp=any])
+
+if test "$apr_wants_sctp" = no; then
+ apr_cv_sctp=no
+else
+ AC_CACHE_CHECK([whether SCTP is supported], [apr_cv_sctp], [
+ AC_TRY_RUN([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -932,6 +940,11 @@ int main(void) {
exit(2);
exit(0);
}], [apr_cv_sctp=yes], [apr_cv_sctp=no], [apr_cv_sctp=no])])
+fi
+
+if test "${apr_wants_sctp}X${apr_cv_sctp}" = yesXno; then
+ AC_MSG_ERROR([SCTP support requested but not available])
+fi
if test "$apr_cv_sctp" = "yes"; then
have_sctp=1