From: Wouter Wijngaards Date: Fri, 5 Oct 2018 15:07:19 +0000 (+0000) Subject: - Set default for so-reuseport to no for FreeBSD. It is enabled X-Git-Tag: release-1.8.2rc1~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fece182cf52e5942b85bed162120b26378ef7b76;p=thirdparty%2Funbound.git - Set default for so-reuseport to no for FreeBSD. It is enabled by default for Linux and DragonFlyBSD. The setting can be configured in unbound.conf to override the default. git-svn-id: file:///svn/unbound/trunk@4932 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/config.h.in b/config.h.in index 7ffb3c989..2f98f193c 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 4f134fca0..5c14d8767 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 772a1417a..48bdb8fab 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/doc/Changelog b/doc/Changelog index b82e06e21..6ec4c07dc 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,9 @@ - Squelch EADDRNOTAVAIL errors when the interface goes away, this omits 'can't assign requested address' errors unless verbosity is set to a high value. + - Set default for so-reuseport to no for FreeBSD. It is enabled + by default for Linux and DragonFlyBSD. The setting can + be configured in unbound.conf to override the default. 2 October 2018: Wouter - updated contrib/fastrpz.patch to apply for this version diff --git a/util/config_file.c b/util/config_file.c index 2568af2eb..e9c312ab0 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;