]> git.ipfire.org Git - thirdparty/bind9.git/commit
Add option to mark TCP dispatch as unshared
authorOndřej Surý <ondrej@isc.org>
Fri, 20 Oct 2023 06:14:27 +0000 (08:14 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 24 Oct 2023 11:07:03 +0000 (13:07 +0200)
commitf213f644edce88b1827442eef071b2a90c65ea19
tree2a42d7e796c8c757c47d7b4d2c0eada3d44e6cc8
parentefbdee5b3a3197c8c003a07521219d3c0ee38d99
Add option to mark TCP dispatch as unshared

The current dispatch code could reuse the TCP connection when
dns_dispatch_gettcp() would be used first.  This is problematic as the
dns_resolver doesn't use TCP connection sharing, but dns_request could
get the TCP stream that was created outside of the dns_request.

Add new DNS_DISPATCHOPT_UNSHARED option to dns_dispatch_createtcp() that
would prevent the TCP stream to be reused.  Use that option in the
dns_resolver call to dns_dispatch_createtcp() to prevent dns_request
from reusing the TCP connections created by dns_resolver.

Additionally, the dns_xfrin unit added TCP connection sharing for
incoming transfers.  While interleaving *xfr streams on a TCP connection
should work this should be a deliberate change and be property of the
server that can be controlled.  Additionally some level of parallel TCP
streams is desirable.  Revert to the old behaviour by removing the
dns_dispatch_gettcp() calls from dns_xfrin and use the new option to
prevent from sharing the transfer streams with dns_request.
lib/dns/dispatch.c
lib/dns/include/dns/dispatch.h
lib/dns/request.c
lib/dns/resolver.c
lib/dns/xfrin.c
tests/dns/dispatch_test.c