bind9/lib/ns
Alessio Podda ae6a34cbda Decouple database and node lifetimes by adding node-specific vtables
All databases in the codebase follow the same structure: a database is
an associative container from DNS names to nodes, and each node is an
associative container from RR types to RR data.

Each database implementation (qpzone, qpcache, sdlz, builtin, dyndb) has
its own corresponding node type (qpznode, qpcnode, etc). However, some
code needs to work with nodes generically regardless of their specific
type - for example, to acquire locks, manage references, or
register/unregister slabs from the heap.

Currently, these generic node operations are implemented as methods in
the database vtable, which creates problematic coupling between database
and node lifetimes. If a node outlives its parent database, the node
destructor will destroy all RR data, and each RR data destructor will
try to unregister from heaps by calling a virtual function from the
database vtable. Since the database was already freed, this causes a
crash.

This commit breaks the coupling by standardizing the layout of all
database nodes, adding a dedicated vtable for node operations, and
moving node-specific methods from the database vtable to the node
vtable.
2025-08-07 11:39:38 -07:00
..
include Refactor the network manager to be a singleton 2025-07-23 22:45:38 +02:00
.gitignore Add support for User Statically Defined Tracing (USDT) probes 2023-08-21 18:39:53 +02:00
client.c Refactor the network manager to be a singleton 2025-07-23 22:45:38 +02:00
hooks.c plugin expand path automatically adds extension 2025-07-28 23:08:04 +02:00
interfacemgr.c Refactor the network manager to be a singleton 2025-07-23 22:45:38 +02:00
listenlist.c make all ISC_LIST_FOREACH calls safe 2025-05-23 13:09:10 -07:00
meson.build replace the build system with meson 2025-06-11 10:30:12 +03:00
notify.c Improve efficiency of ns_client_t reset 2025-07-10 07:19:47 +02:00
probes.d Add a probe when the response rate limiting drops or slips query 2023-08-21 18:39:53 +02:00
query.c Decouple database and node lifetimes by adding node-specific vtables 2025-08-07 11:39:38 -07:00
server.c simplify code around isc_mem_put() and isc_mem_free() 2025-05-28 17:22:32 -07:00
stats.c Remove redundant parentheses from the return statement 2024-11-19 12:27:22 +01:00
tests Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
update.c Decouple database and node lifetimes by adding node-specific vtables 2025-08-07 11:39:38 -07:00
xfrout.c Improve efficiency of ns_client_t reset 2025-07-10 07:19:47 +02:00