bert hubert [Tue, 1 Mar 2016 22:47:22 +0000 (23:47 +0100)]
we prevent an authoritative server to keep its nameservers alive even though they had changed the parent, but this code had a bug which set the TTL of nameserver entries to negative numbers, leading to overly frequent requerying. Closes #3489.
Ruben Kerkhof [Sun, 28 Feb 2016 12:29:58 +0000 (13:29 +0100)]
m4_esyscmd_s only exists in Autoconf 2.64 or newer
Since we like to be able to keep building on RHEL6, which
has autoconf 2.61, use the older m4_esyscmd macro and strip
the newline in the version ourself.
Resolves #3471
Fixes the following error:
$ autoreconf -vif
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
libtoolize: copying file `build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
configure.ac:3: error: possibly undefined macro: m4_esyscmd_s
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
Remi Gacogne [Mon, 8 Feb 2016 11:38:59 +0000 (12:38 +0100)]
dnsdist: Add an optional reuseport param to {add,set}Local()
If set to true, this parameter sets SO_REUSEPORT on platforms
supporting for this option, allowing multiple servers to
bind to the same port.
The same parameter is also added to addDNSCryptBind().
Remi Gacogne [Thu, 25 Feb 2016 17:58:46 +0000 (18:58 +0100)]
dnsdist: Fix str-only server not being added to the default pool
As reported by @pieterlexis, server defined with the "string-only"
syntax were not correctly added to the default pool. This should
fix #3456.
In addition to that, this commit adds some Lua bindings for server
objects:
- member functions `getName()` and `getNameWithAddr()`
- member data `name`
Remi Gacogne [Thu, 25 Feb 2016 16:51:24 +0000 (17:51 +0100)]
dnsdist: Fix cache tests. Clean tests backends.
Several issues:
- the cache tests used a vey small cache, not large enough for the
number of responses we expected to cache during the test suite
- this was hidden by the default response from the backends
matching what the test expected
- and by the backends not counting properly what looked like a
health check but wasn't.
Remi Gacogne [Thu, 25 Feb 2016 14:46:22 +0000 (15:46 +0100)]
dnsdist: Prevent the cache ptr from being altered under our feet
Make sure we hold the Lua mutex before getting the packet cache
shared_ptr, so that we don't have a thread reading it at the
exact same time it is altered by another.
We could have used atomic_load/atomic_store but libstdc++ uses
a pool of mutex for that anyway.
This might fix #3396.
bert hubert [Thu, 25 Feb 2016 12:03:29 +0000 (13:03 +0100)]
this commit uglifies DNSName escaped representation parsing for tremendous speedup (2x) during bulk zone loading from disk or database.
Part of the uglification is that we now special case unescaped names, which are the vast majority of cases.
Simultaneously, this moves us back to DNSName boost::container::string on non-Apple platforms, which delivered another 15% speedup on general operations
Finally, an additional unit test is added.
Remi Gacogne [Wed, 24 Feb 2016 16:13:14 +0000 (17:13 +0100)]
recursor: Move replaced cached entries to the back
When we replace an existing entry, it keeps its existing place in
the expunge queue, while new entries are inserted to the back and
hits are moved to the back.
Moving replaced entries to the back of the queue is more fair and
so probably more efficient, as it would increase the likelihood of
expunging unused expired entries from the cache.
bert hubert [Wed, 24 Feb 2016 15:36:44 +0000 (16:36 +0100)]
we were inconsistent in comparing ComboAddresses with sin_family==0. Removed possibility for inconsistency, plus surrounded this bug with unit tests. Added similar test for DNSName.
Andrew Nelless [Wed, 24 Feb 2016 15:10:22 +0000 (15:10 +0000)]
Switch from std::function to boost::function
GNUs implementation of std::function can't eat 3 pointers without allocating,
(24 bytes) whereas both LLVM libc++ and boost::function can. boost::function
has been move enabled since 1.52 (Nov 2012).