aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2018-11-01 23:42:35 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2018-11-01 23:42:35 +0000
commit209fcf8ed92ea4fdaa7b39ba1d42d3031b149511 (patch)
treebc90fd042b3d92dead6a4fd8d6f70eacb23fa267 /contrib
parentea96b3de2b3e4492e6bba3ab35961e3531a006bd (diff)
parent089d83fbd0b24f957b753d440f188ddadaabf4ff (diff)
downloadsrc-209fcf8ed92ea4fdaa7b39ba1d42d3031b149511.tar.gz
src-209fcf8ed92ea4fdaa7b39ba1d42d3031b149511.zip
Merge upstream r4932: turn so-reuseport option off by default.
MFC after: 3 days
Notes
Notes: svn path=/head/; revision=340037
Diffstat (limited to 'contrib')
-rw-r--r--contrib/unbound/config.h3
-rw-r--r--contrib/unbound/config.h.in3
-rwxr-xr-xcontrib/unbound/configure11
-rw-r--r--contrib/unbound/configure.ac7
-rw-r--r--contrib/unbound/util/config_file.c2
5 files changed, 25 insertions, 1 deletions
diff --git a/contrib/unbound/config.h b/contrib/unbound/config.h
index 73c64a0a5de3..a3ac0c4bdb6c 100644
--- a/contrib/unbound/config.h
+++ b/contrib/unbound/config.h
@@ -664,6 +664,9 @@
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
+/* if REUSEPORT is enabled by default */
+#define REUSEPORT_DEFAULT 0
+
/* default rootkey location */
#define ROOT_ANCHOR_FILE "/var/unbound/root.key"
diff --git a/contrib/unbound/config.h.in b/contrib/unbound/config.h.in
index 7ffb3c989b10..2f98f193c062 100644
--- a/contrib/unbound/config.h.in
+++ b/contrib/unbound/config.h.in
@@ -663,6 +663,9 @@
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
+/* if REUSEPORT is enabled by default */
+#undef REUSEPORT_DEFAULT
+
/* default rootkey location */
#undef ROOT_ANCHOR_FILE
diff --git a/contrib/unbound/configure b/contrib/unbound/configure
index 4f134fca0bcf..5c14d8767602 100755
--- a/contrib/unbound/configure
+++ b/contrib/unbound/configure
@@ -15966,6 +15966,17 @@ fi
done
+# check if we can use SO_REUSEPORT
+if echo "$host" | grep -i -e linux -e dragonfly >/dev/null; then
+
+$as_echo "#define REUSEPORT_DEFAULT 1" >>confdefs.h
+
+else
+
+$as_echo "#define REUSEPORT_DEFAULT 0" >>confdefs.h
+
+fi
+
# set memory allocation checking if requested
# Check whether --enable-alloc-checks was given.
if test "${enable_alloc_checks+set}" = set; then :
diff --git a/contrib/unbound/configure.ac b/contrib/unbound/configure.ac
index 772a1417a987..48bdb8fab6e4 100644
--- a/contrib/unbound/configure.ac
+++ b/contrib/unbound/configure.ac
@@ -461,6 +461,13 @@ ACX_CHECK_NONBLOCKING_BROKEN
ACX_MKDIR_ONE_ARG
AC_CHECK_FUNCS([strptime],[AC_CHECK_STRPTIME_WORKS],[AC_LIBOBJ([strptime])])
+# check if we can use SO_REUSEPORT
+if echo "$host" | grep -i -e linux -e dragonfly >/dev/null; then
+ AC_DEFINE(REUSEPORT_DEFAULT, 1, [if REUSEPORT is enabled by default])
+else
+ AC_DEFINE(REUSEPORT_DEFAULT, 0, [if REUSEPORT is enabled by default])
+fi
+
# set memory allocation checking if requested
AC_ARG_ENABLE(alloc-checks, AC_HELP_STRING([--enable-alloc-checks],
[ enable to memory allocation statistics, for debug purposes ]),
diff --git a/contrib/unbound/util/config_file.c b/contrib/unbound/util/config_file.c
index 8ef61c8e21b8..1a24ed5019c6 100644
--- a/contrib/unbound/util/config_file.c
+++ b/contrib/unbound/util/config_file.c
@@ -177,7 +177,7 @@ config_create(void)
cfg->if_automatic = 0;
cfg->so_rcvbuf = 0;
cfg->so_sndbuf = 0;
- cfg->so_reuseport = 1;
+ cfg->so_reuseport = REUSEPORT_DEFAULT;
cfg->ip_transparent = 0;
cfg->ip_freebind = 0;
cfg->num_ifs = 0;