diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2018-10-10 20:21:09 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2018-10-10 20:21:09 +0000 |
commit | 089d83fbd0b24f957b753d440f188ddadaabf4ff (patch) | |
tree | 9f0cde1a92f2fe26ab13640f13a07f4e4183aa9d | |
parent | 0a0da7ddd5c01b9259ddad3331e1629ee066505d (diff) | |
download | src-089d83fbd0b24f957b753d440f188ddadaabf4ff.tar.gz src-089d83fbd0b24f957b753d440f188ddadaabf4ff.zip |
Merge upstream r4932: turn so-reuseport option off by default.
Notes
Notes:
svn path=/vendor/unbound/dist/; revision=339291
-rw-r--r-- | config.h.in | 3 | ||||
-rwxr-xr-x | configure | 11 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | util/config_file.c | 2 |
4 files changed, 22 insertions, 1 deletions
diff --git a/config.h.in b/config.h.in index 7ffb3c989b10..2f98f193c062 100644 --- a/config.h.in +++ b/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/configure b/configure index 4f134fca0bcf..5c14d8767602 100755 --- a/configure +++ b/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/configure.ac b/configure.ac index 772a1417a987..48bdb8fab6e4 100644 --- a/configure.ac +++ b/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/util/config_file.c b/util/config_file.c index 2568af2eb5b5..e9c312ab0f54 100644 --- a/util/config_file.c +++ b/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; |