Vladimír Čunát [Mon, 14 Nov 2016 07:13:03 +0000 (08:13 +0100)]
Merge branch 'lua-ffi-structs' into 'master'
lua ffi bindings: fix incorrect structs
Some structures have changed but lua was still using the old ABI.
I think no our lua code used the fields misplaced due to this,
except an example in documentation.
I didn't check much of the ABI in there. I wish I knew some
(half-)automatic way how to do that.
Ondřej Surý [Sat, 12 Nov 2016 09:13:54 +0000 (10:13 +0100)]
Merge branch 'allow_to_set_hostname' into 'master'
Allow to override hostname() with a lua call hostname("example.com")
This changes lua hostname() call to accept optional parameter with new hostname. This is needed to override possibly wrong name used for ephemeral certs.
Vladimír Čunát [Tue, 8 Nov 2016 18:24:28 +0000 (19:24 +0100)]
lua ffi bindings: fix incorrect structs
Some structures have changed but lua was still using the old ABI.
I think no our lua code used the fields misplaced due to this,
except an example in documentation.
I didn't check much of the ABI in there. I wish I knew some
(half-)automatic way how to do that.
Vladimír Čunát [Wed, 2 Nov 2016 10:17:23 +0000 (11:17 +0100)]
Merge branch 'p/lru-rebased' into 'master'
lru: new implementation and also interface
The implementation is now a hybrid, slightly described at top of `lib/generic/lru.h`. Also the API is changed a bit, leading to slight simplification of our use patterns. (EDITED)
Vladimír Čunát [Wed, 31 Aug 2016 15:21:47 +0000 (17:21 +0200)]
lru: new implementation and also interface
The implementation is now similar to set-associative caches
that x86 CPU use. Also the API is changed a bit, leading to
slight simplification of our use patterns.
Ondřej Surý [Tue, 18 Oct 2016 07:39:10 +0000 (09:39 +0200)]
Dynamically resolve SONAME for libknot and libzscanner from Makefile
and set libknot_SONAME and libzscanner_SONAME as lua literals.
Remove now obsolete libpath lua function - use find_soname from
platform.mk to define <arg>_SONAME, add lua_pushliteral to
daemon/engine.c and add -D to daemon/daemon.mk for any new library
loaded from Lua.
Based on [issue 28](https://github.com/CZ-NIC/knot-resolver/issues/28), we were able to boost kresd performance running in a Docker container on DockerCloud by nearly 100% by binding to a single interface:ipaddress. It might be handy for other users to know.
Ondřej Surý [Mon, 3 Oct 2016 11:15:52 +0000 (13:15 +0200)]
Merge branch 'p/net.listen' into 'master'
net.listen: make it more flexible
As noted in #94, it feels natural to call it like:
``net.listen({net.lo, '192.168.1.1'})``
Also minor fixes were done in that function and corresponding docs.
Vladimír Čunát [Wed, 7 Sep 2016 12:46:16 +0000 (14:46 +0200)]
net.listen: make it more flexible
As noted in #94, it feels natural to call it like:
``net.listen({net.lo, '192.168.1.1'})``
Also, minor fixes were done in that function and corresponding docs.
Vladimír Čunát [Wed, 24 Aug 2016 15:08:53 +0000 (17:08 +0200)]
don't use kr_crypto_reinit()
We called kr_crypto_init() just before forking and then _reinit() in
all children, but we never did any cryptography in-between - better
initialize after forking.
Note: the function is KR_EXPORT. It might not be useful anymore, but
its removal would require bumping libkres soname.
Ondřej Surý [Wed, 24 Aug 2016 12:03:29 +0000 (14:03 +0200)]
Reuse packet_source address when retrying over TCP. This prevents
timeouts over TCP when <n> first nameservers timeout over UDP as
previously the TCP would connect again to the first and only the
first nameserver in task->addrlist.
This would need to be ultimately fixed in TCP Fast Retransmit.
Marek Vavrusa [Wed, 24 Aug 2016 00:28:47 +0000 (17:28 -0700)]
lib/resolve: track rtt of all tried servers
when doing fast retransmit, each address may be
contacted 1-N times, but previously only cumulative
RTT was tracked for the NS that sent the answer.
now the approximate query start time is subtracted
from cumulative RTT to give an idea how long it
took since the query was actually sent, and all
the NSs that didn't respond within their retransmit
windows are penalised too
Marek Vavrusa [Tue, 23 Aug 2016 21:17:40 +0000 (14:17 -0700)]
lib/resolve: fixed 0x20 with retransmit
bcf3f4b made query_finalize() to be called on
each outbound query before sending, so each
retransmitted query got different 0x20 case
and the only responses from the latest contacted
NS matched.
reverted back the old behaviour where query case
is randomised when an outbound query is generated,
not before sending