bind9/lib/dns/include/dns
Ondřej Surý 6f317f27ea Fix the thread safety in the dns_dispatch unit
The dispatches are not thread-bound, and used freely between various
threads (see the dns_resolver and dns_request units for details).

This refactoring make sure that all non-const dns_dispatch_t and
dns_dispentry_t members are accessed under a lock, and both object now
track their internal state (NONE, CONNECTING, CONNECTED, CANCELED)
instead of guessing the state from the state of various struct members.

During the refactoring, the artificial limit DNS_DISPATCH_SOCKSQUOTA on
UDP sockets per dispatch was removed as the limiting needs to happen and
happens on in dns_resolver and limiting the number of UDP sockets
artificially in dispatch could lead to unpredictable behaviour in case
one dispatch has the limit exhausted by others are idle.

The TCP artificial limit of DNS_DISPATCH_MAXREQUESTS makes even less
sense as the TCP connections are only reused in the dns_request API
that's not a heavy user of the outgoing connections.

As a side note, the fact that UDP and TCP dispatch pretends to be same
thing, but in fact the connected UDP is handled from dns_dispentry_t and
dns_dispatch_t acts as a broker, but connected TCP is handled from
dns_dispatch_t and dns_dispatchmgr_t acts as a broker doesn't really
help the clarity of this unit.

This refactoring kept to API almost same - only dns_dispatch_cancel()
and dns_dispatch_done() were merged into dns_dispatch_done() as we need
to cancel active netmgr handles in any case to not leave dangling
connections around.  The functions handling UDP and TCP have been mostly
split to their matching counterparts and the dns_dispatch_<function>
functions are now thing wrappers that call <udp|tcp>_dispatch_<function>
based on the socket type.

More debugging-level logging was added to the unit to accomodate for
this fact.
2022-12-19 11:42:13 +01:00
..
acl.h Update clang to version 14 2022-06-16 17:21:11 +02:00
adb.h Clean up and refactor dns_adb_getcookie() 2022-12-15 12:34:26 +00:00
badcache.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
bit.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
byaddr.h Remove dns_lookup and unused functions in dns_byaddr 2022-05-25 14:44:32 +02:00
cache.h change dns_db_settask() to _setloop() 2022-11-30 11:47:35 -08:00
callbacks.h Update clang to version 14 2022-06-16 17:21:11 +02:00
catz.h Create the catalog zones update timer on demand 2022-09-21 14:25:33 -07:00
cert.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
client.h Update netmgr, tasks, and applications to use isc_loopmgr 2022-08-26 09:09:24 +02:00
clientinfo.h Update clang to version 14 2022-06-16 17:21:11 +02:00
compress.h Compress zone transfers properly 2022-11-30 12:16:09 +00:00
db.h Add dns_db_allrdatasets options 2022-12-07 22:20:02 +00:00
dbiterator.h Remove the unused cache cleaning mechanism from dns_cache API 2022-11-29 13:48:33 -08:00
diff.h Update clang to version 14 2022-06-16 17:21:11 +02:00
dispatch.h Fix the thread safety in the dns_dispatch unit 2022-12-19 11:42:13 +01:00
dlz.h Update clang to version 14 2022-06-16 17:21:11 +02:00
dlz_dlopen.h Update clang to version 14 2022-06-16 17:21:11 +02:00
dns64.h Add isc_rwlock around dns_aclenv .localhost and .localnets member 2022-04-04 19:27:00 +02:00
dnsrps.h Update clang to version 14 2022-06-16 17:21:11 +02:00
dnssec.h Update dns_dnssec_syncdelete() function 2022-04-13 13:26:59 +02:00
dnstap.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
ds.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
dsdigest.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
dyndb.h Update isc_timer to use isc_loopmgr 2022-08-25 17:17:07 +02:00
ecs.h update dlz_minimal.h 2022-01-27 15:48:50 -08:00
edns.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
events.h Refactor dns_master_loadfileinc() to use loopmgr instead of tasks 2022-10-30 14:56:40 -07:00
fixedname.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
forward.h Cleanup dns_fwdtable_delete() 2022-06-09 10:47:04 +00:00
geoip.h Update clang to version 14 2022-06-16 17:21:11 +02:00
ipkeylist.h Update clang to version 14 2022-06-16 17:21:11 +02:00
iptable.h Update clang to version 14 2022-06-16 17:21:11 +02:00
journal.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
kasp.h Store built-in dnssec-policies in defaultconf 2022-06-28 11:56:31 +02:00
keydata.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
keyflags.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
keymgr.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
keytable.h Add synth-from-dnssec namespaces for keytable entries 2022-07-05 12:29:01 +10:00
keyvalues.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
librpz.h Use the semantic patch to do the unsigned -> unsigned int change 2022-09-19 15:56:02 +02:00
log.h Update clang to version 14 2022-06-16 17:21:11 +02:00
master.h Move the zone loading to the offloaded threads 2022-10-30 14:56:40 -07:00
masterdump.h refactor dns_master_dump*async() to use loop callbacks 2022-10-31 10:30:27 +00:00
message.h Add the ability specify the signing / verification time 2022-09-26 16:28:12 +02:00
name.h Simplify and speed up DNS name decompression 2022-11-17 08:45:15 +00:00
ncache.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
nsec.h Wait with NSEC3 during a DNSSEC policy change 2022-08-22 15:55:46 +02:00
nsec3.h Update clang to version 14 2022-06-16 17:21:11 +02:00
nta.h Create the negative trust anchor timer on the current loop 2022-09-21 14:25:33 -07:00
opcode.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
order.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
peer.h Add server clause require-cookie 2022-09-13 12:07:13 +10:00
private.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
rbt.h Replace #define DNS_NAMEATTR_ with struct of bools 2022-10-13 17:04:02 +02:00
rcode.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
rdata.h Add dns_rdata_checksvcb 2022-10-29 00:22:54 +11:00
rdataclass.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
rdatalist.h dns_rdatalist_tordataset() and dns_rdatalist_fromrdataset() can not fail 2022-08-09 08:19:51 +00:00
rdataset.h Update clang to version 14 2022-06-16 17:21:11 +02:00
rdatasetiter.h Extend dns_db_allrdatasets to control interation results 2022-12-07 22:20:02 +00:00
rdataslab.h Ditch a couple of unused #defines 2022-05-03 09:30:28 +00:00
rdatatype.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
request.h Simplify and speed up DNS name compression 2022-10-17 08:45:44 +02:00
resolver.h Refactor the dns_resolver fetch context hash tables and locking 2022-12-01 11:42:46 +01:00
result.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
rootns.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
rpz.h Refactor dns_rpz unit to use single reference counting 2022-11-30 09:59:35 +01:00
rriterator.h Update clang to version 14 2022-06-16 17:21:11 +02:00
rrl.h Fix RRL responses-per-second bypass using wildcard names 2022-09-08 09:15:30 +02:00
sdb.h Update clang to version 14 2022-06-16 17:21:11 +02:00
sdlz.h Update clang to version 14 2022-06-16 17:21:11 +02:00
secalg.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
secproto.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
soa.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
ssu.h Add isc_rwlock around dns_aclenv .localhost and .localnets member 2022-04-04 19:27:00 +02:00
stats.h Emit key algorithm + key id in dnssec signing statsistics 2022-09-15 08:42:45 +10:00
time.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
tkey.h Update clang to version 14 2022-06-16 17:21:11 +02:00
transport.h Implement DoT support for nsupdate 2022-09-23 13:23:49 +00:00
tsig.h Update clang to version 14 2022-06-16 17:21:11 +02:00
ttl.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
types.h Remove unused lib/dns/tsec 2022-10-25 10:35:07 +02:00
update.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
validator.h Update clang to version 14 2022-06-16 17:21:11 +02:00
view.h Record the 'edns-udp-size' in the view, not in the resolver 2022-10-05 11:59:36 -07:00
xfrin.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
zone.h Call dns_db_updatenotify_unregister earlier 2022-12-07 09:04:08 +11:00
zonekey.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
zoneverify.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
zt.h Have dns_zt_apply lock the zone table 2022-11-11 15:26:11 +00:00