2014-08-05 03:57:52 -04:00
|
|
|
/* dnstap support for Unbound */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013-2014, Farsight Security, Inc.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
|
* are met:
|
|
|
|
|
*
|
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
|
*
|
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
|
*
|
|
|
|
|
* 3. Neither the name of the copyright holder nor the names of its
|
|
|
|
|
* contributors may be used to endorse or promote products derived from
|
|
|
|
|
* this software without specific prior written permission.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "dnstap/dnstap_config.h"
|
|
|
|
|
|
|
|
|
|
#ifdef USE_DNSTAP
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
2014-11-07 04:09:04 -05:00
|
|
|
#include <string.h>
|
2014-08-05 03:57:52 -04:00
|
|
|
#include <sys/time.h>
|
2018-10-22 06:19:30 -04:00
|
|
|
#ifdef HAVE_SYS_STAT_H
|
2018-10-22 06:17:38 -04:00
|
|
|
#include <sys/stat.h>
|
2018-10-22 06:19:30 -04:00
|
|
|
#endif
|
2018-10-22 06:17:38 -04:00
|
|
|
#include <errno.h>
|
2015-03-26 06:21:38 -04:00
|
|
|
#include "sldns/sbuffer.h"
|
2014-08-05 03:57:52 -04:00
|
|
|
#include "util/config_file.h"
|
|
|
|
|
#include "util/net_help.h"
|
|
|
|
|
#include "util/netevent.h"
|
|
|
|
|
#include "util/log.h"
|
|
|
|
|
|
|
|
|
|
#include <protobuf-c/protobuf-c.h>
|
|
|
|
|
|
|
|
|
|
#include "dnstap/dnstap.h"
|
2020-01-21 08:50:37 -05:00
|
|
|
#include "dnstap/dtstream.h"
|
2014-08-05 03:57:52 -04:00
|
|
|
#include "dnstap/dnstap.pb-c.h"
|
|
|
|
|
|
|
|
|
|
#define DNSTAP_INITIAL_BUF_SIZE 256
|
|
|
|
|
|
|
|
|
|
struct dt_msg {
|
|
|
|
|
void *buf;
|
|
|
|
|
size_t len_buf;
|
|
|
|
|
Dnstap__Dnstap d;
|
|
|
|
|
Dnstap__Message m;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
dt_pack(const Dnstap__Dnstap *d, void **buf, size_t *sz)
|
|
|
|
|
{
|
|
|
|
|
ProtobufCBufferSimple sbuf;
|
|
|
|
|
|
2014-11-07 04:09:04 -05:00
|
|
|
memset(&sbuf, 0, sizeof(sbuf));
|
2014-08-05 03:57:52 -04:00
|
|
|
sbuf.base.append = protobuf_c_buffer_simple_append;
|
|
|
|
|
sbuf.len = 0;
|
|
|
|
|
sbuf.alloced = DNSTAP_INITIAL_BUF_SIZE;
|
|
|
|
|
sbuf.data = malloc(sbuf.alloced);
|
|
|
|
|
if (sbuf.data == NULL)
|
|
|
|
|
return 0;
|
|
|
|
|
sbuf.must_free_data = 1;
|
|
|
|
|
|
|
|
|
|
*sz = dnstap__dnstap__pack_to_buffer(d, (ProtobufCBuffer *) &sbuf);
|
|
|
|
|
if (sbuf.data == NULL)
|
|
|
|
|
return 0;
|
|
|
|
|
*buf = sbuf.data;
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-19 04:04:40 -04:00
|
|
|
/** See if the message is sent due to dnstap sample rate */
|
|
|
|
|
static int
|
|
|
|
|
dt_sample_rate_limited(struct dt_env* env)
|
|
|
|
|
{
|
|
|
|
|
lock_basic_lock(&env->sample_lock);
|
|
|
|
|
/* Sampling is every [n] packets. Where n==1, every packet is sent */
|
|
|
|
|
if(env->sample_rate > 1) {
|
|
|
|
|
int submit = 0;
|
|
|
|
|
/* if sampling is engaged... */
|
|
|
|
|
if (env->sample_rate_count > env->sample_rate) {
|
|
|
|
|
/* once the count passes the limit */
|
|
|
|
|
/* submit the message */
|
|
|
|
|
submit = 1;
|
|
|
|
|
/* and reset the count */
|
|
|
|
|
env->sample_rate_count = 0;
|
|
|
|
|
}
|
|
|
|
|
/* increment count regardless */
|
|
|
|
|
env->sample_rate_count++;
|
|
|
|
|
lock_basic_unlock(&env->sample_lock);
|
|
|
|
|
return !submit;
|
|
|
|
|
}
|
|
|
|
|
lock_basic_unlock(&env->sample_lock);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 03:57:52 -04:00
|
|
|
static void
|
|
|
|
|
dt_send(const struct dt_env *env, void *buf, size_t len_buf)
|
|
|
|
|
{
|
2020-01-21 08:50:37 -05:00
|
|
|
dt_msg_queue_submit(env->msgqueue, buf, len_buf);
|
2014-08-05 03:57:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dt_msg_init(const struct dt_env *env,
|
|
|
|
|
struct dt_msg *dm,
|
|
|
|
|
Dnstap__Message__Type mtype)
|
|
|
|
|
{
|
|
|
|
|
memset(dm, 0, sizeof(*dm));
|
|
|
|
|
dm->d.base.descriptor = &dnstap__dnstap__descriptor;
|
|
|
|
|
dm->m.base.descriptor = &dnstap__message__descriptor;
|
|
|
|
|
dm->d.type = DNSTAP__DNSTAP__TYPE__MESSAGE;
|
|
|
|
|
dm->d.message = &dm->m;
|
|
|
|
|
dm->m.type = mtype;
|
|
|
|
|
if (env->identity != NULL) {
|
|
|
|
|
dm->d.identity.data = (uint8_t *) env->identity;
|
|
|
|
|
dm->d.identity.len = (size_t) env->len_identity;
|
|
|
|
|
dm->d.has_identity = 1;
|
|
|
|
|
}
|
|
|
|
|
if (env->version != NULL) {
|
|
|
|
|
dm->d.version.data = (uint8_t *) env->version;
|
|
|
|
|
dm->d.version.len = (size_t) env->len_version;
|
|
|
|
|
dm->d.has_version = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 06:17:38 -04:00
|
|
|
/* check that the socket file can be opened and exists, print error if not */
|
|
|
|
|
static void
|
|
|
|
|
check_socket_file(const char* socket_path)
|
|
|
|
|
{
|
|
|
|
|
struct stat statbuf;
|
|
|
|
|
memset(&statbuf, 0, sizeof(statbuf));
|
|
|
|
|
if(stat(socket_path, &statbuf) < 0) {
|
|
|
|
|
log_warn("could not open dnstap-socket-path: %s, %s",
|
|
|
|
|
socket_path, strerror(errno));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 03:57:52 -04:00
|
|
|
struct dt_env *
|
2020-02-14 08:44:02 -05:00
|
|
|
dt_create(struct config_file* cfg)
|
2014-08-05 03:57:52 -04:00
|
|
|
{
|
|
|
|
|
struct dt_env *env;
|
|
|
|
|
|
2020-02-14 08:44:02 -05:00
|
|
|
if(cfg->dnstap && cfg->dnstap_socket_path && cfg->dnstap_socket_path[0] &&
|
|
|
|
|
(cfg->dnstap_ip==NULL || cfg->dnstap_ip[0]==0)) {
|
2020-10-09 02:57:23 -04:00
|
|
|
char* p = cfg->dnstap_socket_path;
|
|
|
|
|
if(cfg->chrootdir && cfg->chrootdir[0] && strncmp(p,
|
|
|
|
|
cfg->chrootdir, strlen(cfg->chrootdir)) == 0)
|
|
|
|
|
p += strlen(cfg->chrootdir);
|
2020-02-14 08:44:02 -05:00
|
|
|
verbose(VERB_OPS, "attempting to connect to dnstap socket %s",
|
2020-08-24 08:55:16 -04:00
|
|
|
p);
|
|
|
|
|
check_socket_file(p);
|
2020-02-14 08:44:02 -05:00
|
|
|
}
|
2014-08-05 03:57:52 -04:00
|
|
|
|
|
|
|
|
env = (struct dt_env *) calloc(1, sizeof(struct dt_env));
|
|
|
|
|
if (!env)
|
|
|
|
|
return NULL;
|
2024-07-19 04:04:40 -04:00
|
|
|
lock_basic_init(&env->sample_lock);
|
2014-08-05 03:57:52 -04:00
|
|
|
|
2020-01-21 11:01:25 -05:00
|
|
|
env->dtio = dt_io_thread_create();
|
|
|
|
|
if(!env->dtio) {
|
|
|
|
|
log_err("malloc failure");
|
|
|
|
|
free(env);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2020-01-31 11:07:40 -05:00
|
|
|
if(!dt_io_thread_apply_cfg(env->dtio, cfg)) {
|
2020-02-19 11:33:36 -05:00
|
|
|
dt_io_thread_delete(env->dtio);
|
2020-01-31 11:07:40 -05:00
|
|
|
free(env);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2020-01-21 11:01:25 -05:00
|
|
|
dt_apply_cfg(env, cfg);
|
2014-08-05 03:57:52 -04:00
|
|
|
return env;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dt_apply_identity(struct dt_env *env, struct config_file *cfg)
|
|
|
|
|
{
|
|
|
|
|
char buf[MAXHOSTNAMELEN+1];
|
Fast Reload Option (#1042)
* - fast-reload, add unbound-control fast_reload
* - fast-reload, make a thread to service the unbound-control command.
* - fast-reload, communication sockets for information transfer.
* - fast-reload, fix compile for unbound-dnstap-socket.
* - fast-reload, set nonblocking communication to keep the server thread
responding to DNS requests.
* - fast-reload, poll routine to test for readiness, timeout fails connection.
* - fast-reload, detect loop in sock_poll_timeout routine.
* - fast-reload, send done and exited notification.
* - fast-reload, defines for constants in ipc.
* - fast-reload, ipc socket recv and send resists partial reads and writes and
can continue byte by byte. Also it can continue after an interrupt.
* - fast-reload, send exit command to thread when done.
* - fast-reload, output strings for client on string list.
* - fast-reload, add newline to terminal output.
* - fast-reload, send client string to remote client.
* - fast-reload, better debug output.
* - fast-reload, print queue structure, for output to the remote client.
* - fast-reload, move print items to print queue from fast_reload_thread struct.
* - fast-reload, keep list of pending print queue items in daemon struct.
* - fast-reload, comment explains in_list for printq to print remainder.
* - fast-reload, unit test testdata/fast_reload_thread.tdir that tests the
thread output.
* - fast-reload, fix test link for fast_reload_printq_list_delete function.
* - fast-reload, reread config file from disk.
* - fast-reload, unshare forwards, making the structure locked, with an rwlock.
* - fast-reload, for nonthreaded, the unbound-control commands forward,
forward_add and forward_delete should be distributed to other processes,
but when threaded, they should not be distributed to other threads because
the structure is not thread specific any more.
* - fast-reload, unshared stub hints, making the structure locked, with an rwlock.
* - fast-reload, helpful comments for hints lookup function return value.
* - fast-reload, fix bug in fast reload printout, the strlist appendlist routine,
and printout time statistics after the reload is done.
* - fast-reload, keep track of reloadtime and deletestime and print them.
* - fast-reload, keep track of constructtime and print it.
* - fast-reload, construct new items.
* - fast-reload, better comment.
* - fast-reload, reload the config and swap trees for forwards and stub hints.
* - fast-reload, in forwards_swap_tree set protection of trees with locks.
* - fast-reload, in hints_swap_tree also swap the node count of the trees.
* - fast-reload, reload ipc to stop and start threads.
* - fast-reload, unused forward declarations removed.
* - fast-reload, unit test that fast reload works with forwards and stubs.
* - fast-reload, fix clang analyzer warnings.
* - fast-reload, small documentation entry in unbound-control -h output.
* - fast-reload, printout memory use by fast reload, in bytes.
* - fast-reload, compile without threads.
* - fast-reload, document fast_reload in man page.
* - fast-reload, print ok when done successfully.
* - fast-reload, option for fast-reload commandline, +v verbosity option,
with timing and memory use output.
* - fast-reload, option for fast-reload commandline, +p does not pause threads.
* - fast-reload, option for fast-reload commandline, +d drops mesh queries.
* - fast-reload, fix to poll every thread with nopause to make certain that
resources are not held by the threads and can be deleted.
* - fast-reload, fix to use atomic store for config variables with nopause.
* - fast-reload, reload views.
* - fast-reload, when tag defines are different, it drops the queries.
* - fast-reload, fix tag define check.
* - fast-reload, document that tag change causes drop of queries.
* - fast-reload, fix space in documentation man page.
* - fast-reload, copy respip client information to query state, put views tree
in module env for lookup.
* - fast-reload, nicer respip view comparison.
* - fast-reload, respip global set is in module env.
* - fast-reload, document that respip_client_info acl info is copied.
* - fast-reload, reload the respip_set.
* - fast-reload, document no pause and pick up of use_response_ip boolean.
* - fast-reload, fix test compile.
* - fast-reload, reload local zones.
* Update locking management for iter_fwd and iter_hints methods. (#1054)
fast reload, move most of the locking management to iter_fwd and
iter_hints methods. The caller still has the ability to handle its
own locking, if desired, for atomic operations on sets of different
structs.
Co-authored-by: Wouter Wijngaards <wcawijngaards@users.noreply.github.com>
* - fast-reload, reload access-control.
* - fast-reload, reload access control interface, such as interface-action.
* - fast-reload, reload tcp-connection-limit.
* - fast-reload, improve comments on acl_list and tcl_list swap tree.
* - fast-reload, fixup references to old tcp connection limits in open tcp
connections.
* - fast-reload, fixup to clean tcp connection also for different linked order.
* - fast-reload, if no tcp connection limits existed, no need to remove
references for that.
* - fast-reload, document more options that work and do not work.
* - fast-reload, reload auth_zone and rpz data.
* - fast-reload, fix auth_zones_get_mem.
* - fast-reload, fix compilation of testbound for the new comm_timer_get_mem
reference in remote control.
* - fast-reload, change use_rpz with reload.
* - fast-reload, list changes in auth zones and stop zonemd callbacks for
deleted auth zones.
* - fast-reload, note xtree is not swapped, and why it is not swapped.
* - fast-reload, for added auth zones, pick up zone transfer and zonemd tasks.
* - fast-reload, unlock xfr when done with transfer pick up.
* - fast-reload, unlock z when picking up the xfr for it during transfer task
pick up.
* - fast-reload, pick up task changes for added, deleted and modified auth zones.
* - fast-reload, remove xfr of auth zone deletion without tasks.
* - fast-reload, pick up zone transfer config.
* - fast-reload, the main worker thread picks up the transfer tasks and also
performs setup of the xfer struct.
* - fast-reload, keep writelock on newzone when auth zone changes.
* - fast-reload, change cachedb_enabled setting.
* - fast-reload, pick up edns-strings config.
* - fast-reload, note that settings are not updated.
* - fast-reload, pick up dnstap config.
* - fast-reload, dnstap options that need to be loaded without +p.
* - fast-reload, fix auth zone reload
* - fast-reload, remove debug for auth zone test.
* - fast-reload, fix auth zone reload with zone transfer.
* - fast-reload, fix auth zone reload lock order.
* - fast-reload, remove debug from fast reload test.
* - fast-reload, remove unused function.
* - fast-reload, fix the worker trust anchor probe timer lock acquisition in
the probe answer callback routine for trust anchor probes.
* - fast-reload, reload trust anchors.
* - fast-reload, fix trust anchor reload lock on autr global data and test
for trust anchor reload.
* - fast-reload, adjust cache sizes.
* - fast-reload, reload cache sizes when changed.
* - fast-reload, reload validator env changes.
* - fast-reload, reload mesh changes.
* - fast-reload, check for incompatible changes.
* - fast-reload, improve error text for incompatible change.
* - fast-reload, fix check config option compatibility.
* - fast-reload, improve error text for nopause change.
* - fast-reload, fix spelling of incompatible options.
* - fast-reload, reload target-fetch-policy, outbound-msg-retry, max-sent-count
and max-query-restarts.
* - fast-reload, check nopause config change for target-fetch-policy.
* - fast-reload, reload do-not-query-address, private-address and capt-exempt.
* - fast-reload, check nopause config change for do-not-query-address,
private-address and capt-exempt.
* - fast-reload, check fast reload not possible due to interface and
outgoing-interface changes.
* - fast-reload, reload nat64 settings.
* - fast-reload, reload settings stored in the infra structure.
* - fast-reload, fix modstack lookup and remove outgoing-range check.
* - fast-reload, more explanation for config parse failure.
* - fast-reload, reload worker outside network changes.
* - fast-reload, detect incompatible changes in network settings.
* fast-reload, commit test files.
* - fast-reload, fix warnings for call types in windows compile.
* - fast-reload, fix warnings and comm_point_internal for tcp wouldblock calls.
* - fast-reload, extend lock checks for repeat thread ids.
* - fast-reload, additional test cases, cache change and tag changes.
* - fast-reload, fix documentation for auth_zone_verify_zonemd_with_key.
* - fast-reload, fix copy_cfg type casts and memory leak on config parse failure.
* - fast-reload, fix use of WSAPoll.
* Review comments for the fast reload feature (#1259)
* - fast-reload review, respip set can be null from a view.
* - fast-reload review, typos.
* - fast-reload review, keep clang static analyzer happy.
* - fast-reload review, don't forget to copy tag_actions.
* - fast-reload review, less indentation.
* - fast-reload review, don't leak respip_actions when reloading.
* - fast-reload review, protect NULL pointer dereference in get_mem
functions.
* - fast-reload review, add fast_reload_most_options.tdir to test most
options with high verbosity when fast reloading.
* - fast-reload review, don't skip new line on long error printouts.
* - fast-reload review, typo.
* - fast-reload review, use new_z for consistency.
* - fast-reload review, nit for unlock ordering to make eye comparison
with the lock counterpart easier.
* - fast-reload review, in case of error the sockets are already closed.
* - fast-reload review, identation.
* - fast-reload review, add static keywords.
* - fast-reload review, update unbound-control usage text.
* - fast-reload review, updates to the man page.
* - fast-reload, the fast-reload command is experimental.
* - fast-reload, fix compile of doqclient for fast reload functions.
* Changelog comment for #1042
- Merge #1042: Fast Reload. The unbound-control fast_reload is added.
It reads changed config in a thread, then only briefly pauses the
service threads, that keep running. DNS service is only interrupted
briefly, less than a second.
---------
Co-authored-by: Yorgos Thessalonikefs <yorgos@nlnetlabs.nl>
2025-03-31 09:25:24 -04:00
|
|
|
if (!cfg->dnstap_send_identity) {
|
|
|
|
|
free(env->identity);
|
|
|
|
|
env->identity = NULL;
|
2014-08-05 03:57:52 -04:00
|
|
|
return;
|
Fast Reload Option (#1042)
* - fast-reload, add unbound-control fast_reload
* - fast-reload, make a thread to service the unbound-control command.
* - fast-reload, communication sockets for information transfer.
* - fast-reload, fix compile for unbound-dnstap-socket.
* - fast-reload, set nonblocking communication to keep the server thread
responding to DNS requests.
* - fast-reload, poll routine to test for readiness, timeout fails connection.
* - fast-reload, detect loop in sock_poll_timeout routine.
* - fast-reload, send done and exited notification.
* - fast-reload, defines for constants in ipc.
* - fast-reload, ipc socket recv and send resists partial reads and writes and
can continue byte by byte. Also it can continue after an interrupt.
* - fast-reload, send exit command to thread when done.
* - fast-reload, output strings for client on string list.
* - fast-reload, add newline to terminal output.
* - fast-reload, send client string to remote client.
* - fast-reload, better debug output.
* - fast-reload, print queue structure, for output to the remote client.
* - fast-reload, move print items to print queue from fast_reload_thread struct.
* - fast-reload, keep list of pending print queue items in daemon struct.
* - fast-reload, comment explains in_list for printq to print remainder.
* - fast-reload, unit test testdata/fast_reload_thread.tdir that tests the
thread output.
* - fast-reload, fix test link for fast_reload_printq_list_delete function.
* - fast-reload, reread config file from disk.
* - fast-reload, unshare forwards, making the structure locked, with an rwlock.
* - fast-reload, for nonthreaded, the unbound-control commands forward,
forward_add and forward_delete should be distributed to other processes,
but when threaded, they should not be distributed to other threads because
the structure is not thread specific any more.
* - fast-reload, unshared stub hints, making the structure locked, with an rwlock.
* - fast-reload, helpful comments for hints lookup function return value.
* - fast-reload, fix bug in fast reload printout, the strlist appendlist routine,
and printout time statistics after the reload is done.
* - fast-reload, keep track of reloadtime and deletestime and print them.
* - fast-reload, keep track of constructtime and print it.
* - fast-reload, construct new items.
* - fast-reload, better comment.
* - fast-reload, reload the config and swap trees for forwards and stub hints.
* - fast-reload, in forwards_swap_tree set protection of trees with locks.
* - fast-reload, in hints_swap_tree also swap the node count of the trees.
* - fast-reload, reload ipc to stop and start threads.
* - fast-reload, unused forward declarations removed.
* - fast-reload, unit test that fast reload works with forwards and stubs.
* - fast-reload, fix clang analyzer warnings.
* - fast-reload, small documentation entry in unbound-control -h output.
* - fast-reload, printout memory use by fast reload, in bytes.
* - fast-reload, compile without threads.
* - fast-reload, document fast_reload in man page.
* - fast-reload, print ok when done successfully.
* - fast-reload, option for fast-reload commandline, +v verbosity option,
with timing and memory use output.
* - fast-reload, option for fast-reload commandline, +p does not pause threads.
* - fast-reload, option for fast-reload commandline, +d drops mesh queries.
* - fast-reload, fix to poll every thread with nopause to make certain that
resources are not held by the threads and can be deleted.
* - fast-reload, fix to use atomic store for config variables with nopause.
* - fast-reload, reload views.
* - fast-reload, when tag defines are different, it drops the queries.
* - fast-reload, fix tag define check.
* - fast-reload, document that tag change causes drop of queries.
* - fast-reload, fix space in documentation man page.
* - fast-reload, copy respip client information to query state, put views tree
in module env for lookup.
* - fast-reload, nicer respip view comparison.
* - fast-reload, respip global set is in module env.
* - fast-reload, document that respip_client_info acl info is copied.
* - fast-reload, reload the respip_set.
* - fast-reload, document no pause and pick up of use_response_ip boolean.
* - fast-reload, fix test compile.
* - fast-reload, reload local zones.
* Update locking management for iter_fwd and iter_hints methods. (#1054)
fast reload, move most of the locking management to iter_fwd and
iter_hints methods. The caller still has the ability to handle its
own locking, if desired, for atomic operations on sets of different
structs.
Co-authored-by: Wouter Wijngaards <wcawijngaards@users.noreply.github.com>
* - fast-reload, reload access-control.
* - fast-reload, reload access control interface, such as interface-action.
* - fast-reload, reload tcp-connection-limit.
* - fast-reload, improve comments on acl_list and tcl_list swap tree.
* - fast-reload, fixup references to old tcp connection limits in open tcp
connections.
* - fast-reload, fixup to clean tcp connection also for different linked order.
* - fast-reload, if no tcp connection limits existed, no need to remove
references for that.
* - fast-reload, document more options that work and do not work.
* - fast-reload, reload auth_zone and rpz data.
* - fast-reload, fix auth_zones_get_mem.
* - fast-reload, fix compilation of testbound for the new comm_timer_get_mem
reference in remote control.
* - fast-reload, change use_rpz with reload.
* - fast-reload, list changes in auth zones and stop zonemd callbacks for
deleted auth zones.
* - fast-reload, note xtree is not swapped, and why it is not swapped.
* - fast-reload, for added auth zones, pick up zone transfer and zonemd tasks.
* - fast-reload, unlock xfr when done with transfer pick up.
* - fast-reload, unlock z when picking up the xfr for it during transfer task
pick up.
* - fast-reload, pick up task changes for added, deleted and modified auth zones.
* - fast-reload, remove xfr of auth zone deletion without tasks.
* - fast-reload, pick up zone transfer config.
* - fast-reload, the main worker thread picks up the transfer tasks and also
performs setup of the xfer struct.
* - fast-reload, keep writelock on newzone when auth zone changes.
* - fast-reload, change cachedb_enabled setting.
* - fast-reload, pick up edns-strings config.
* - fast-reload, note that settings are not updated.
* - fast-reload, pick up dnstap config.
* - fast-reload, dnstap options that need to be loaded without +p.
* - fast-reload, fix auth zone reload
* - fast-reload, remove debug for auth zone test.
* - fast-reload, fix auth zone reload with zone transfer.
* - fast-reload, fix auth zone reload lock order.
* - fast-reload, remove debug from fast reload test.
* - fast-reload, remove unused function.
* - fast-reload, fix the worker trust anchor probe timer lock acquisition in
the probe answer callback routine for trust anchor probes.
* - fast-reload, reload trust anchors.
* - fast-reload, fix trust anchor reload lock on autr global data and test
for trust anchor reload.
* - fast-reload, adjust cache sizes.
* - fast-reload, reload cache sizes when changed.
* - fast-reload, reload validator env changes.
* - fast-reload, reload mesh changes.
* - fast-reload, check for incompatible changes.
* - fast-reload, improve error text for incompatible change.
* - fast-reload, fix check config option compatibility.
* - fast-reload, improve error text for nopause change.
* - fast-reload, fix spelling of incompatible options.
* - fast-reload, reload target-fetch-policy, outbound-msg-retry, max-sent-count
and max-query-restarts.
* - fast-reload, check nopause config change for target-fetch-policy.
* - fast-reload, reload do-not-query-address, private-address and capt-exempt.
* - fast-reload, check nopause config change for do-not-query-address,
private-address and capt-exempt.
* - fast-reload, check fast reload not possible due to interface and
outgoing-interface changes.
* - fast-reload, reload nat64 settings.
* - fast-reload, reload settings stored in the infra structure.
* - fast-reload, fix modstack lookup and remove outgoing-range check.
* - fast-reload, more explanation for config parse failure.
* - fast-reload, reload worker outside network changes.
* - fast-reload, detect incompatible changes in network settings.
* fast-reload, commit test files.
* - fast-reload, fix warnings for call types in windows compile.
* - fast-reload, fix warnings and comm_point_internal for tcp wouldblock calls.
* - fast-reload, extend lock checks for repeat thread ids.
* - fast-reload, additional test cases, cache change and tag changes.
* - fast-reload, fix documentation for auth_zone_verify_zonemd_with_key.
* - fast-reload, fix copy_cfg type casts and memory leak on config parse failure.
* - fast-reload, fix use of WSAPoll.
* Review comments for the fast reload feature (#1259)
* - fast-reload review, respip set can be null from a view.
* - fast-reload review, typos.
* - fast-reload review, keep clang static analyzer happy.
* - fast-reload review, don't forget to copy tag_actions.
* - fast-reload review, less indentation.
* - fast-reload review, don't leak respip_actions when reloading.
* - fast-reload review, protect NULL pointer dereference in get_mem
functions.
* - fast-reload review, add fast_reload_most_options.tdir to test most
options with high verbosity when fast reloading.
* - fast-reload review, don't skip new line on long error printouts.
* - fast-reload review, typo.
* - fast-reload review, use new_z for consistency.
* - fast-reload review, nit for unlock ordering to make eye comparison
with the lock counterpart easier.
* - fast-reload review, in case of error the sockets are already closed.
* - fast-reload review, identation.
* - fast-reload review, add static keywords.
* - fast-reload review, update unbound-control usage text.
* - fast-reload review, updates to the man page.
* - fast-reload, the fast-reload command is experimental.
* - fast-reload, fix compile of doqclient for fast reload functions.
* Changelog comment for #1042
- Merge #1042: Fast Reload. The unbound-control fast_reload is added.
It reads changed config in a thread, then only briefly pauses the
service threads, that keep running. DNS service is only interrupted
briefly, less than a second.
---------
Co-authored-by: Yorgos Thessalonikefs <yorgos@nlnetlabs.nl>
2025-03-31 09:25:24 -04:00
|
|
|
}
|
2014-08-05 03:57:52 -04:00
|
|
|
free(env->identity);
|
|
|
|
|
if (cfg->dnstap_identity == NULL || cfg->dnstap_identity[0] == 0) {
|
|
|
|
|
if (gethostname(buf, MAXHOSTNAMELEN) == 0) {
|
|
|
|
|
buf[MAXHOSTNAMELEN] = 0;
|
|
|
|
|
env->identity = strdup(buf);
|
|
|
|
|
} else {
|
|
|
|
|
fatal_exit("dt_apply_identity: gethostname() failed");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
env->identity = strdup(cfg->dnstap_identity);
|
|
|
|
|
}
|
|
|
|
|
if (env->identity == NULL)
|
|
|
|
|
fatal_exit("dt_apply_identity: strdup() failed");
|
2014-08-18 10:42:26 -04:00
|
|
|
env->len_identity = (unsigned int)strlen(env->identity);
|
2014-08-05 03:57:52 -04:00
|
|
|
verbose(VERB_OPS, "dnstap identity field set to \"%s\"",
|
|
|
|
|
env->identity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dt_apply_version(struct dt_env *env, struct config_file *cfg)
|
|
|
|
|
{
|
Fast Reload Option (#1042)
* - fast-reload, add unbound-control fast_reload
* - fast-reload, make a thread to service the unbound-control command.
* - fast-reload, communication sockets for information transfer.
* - fast-reload, fix compile for unbound-dnstap-socket.
* - fast-reload, set nonblocking communication to keep the server thread
responding to DNS requests.
* - fast-reload, poll routine to test for readiness, timeout fails connection.
* - fast-reload, detect loop in sock_poll_timeout routine.
* - fast-reload, send done and exited notification.
* - fast-reload, defines for constants in ipc.
* - fast-reload, ipc socket recv and send resists partial reads and writes and
can continue byte by byte. Also it can continue after an interrupt.
* - fast-reload, send exit command to thread when done.
* - fast-reload, output strings for client on string list.
* - fast-reload, add newline to terminal output.
* - fast-reload, send client string to remote client.
* - fast-reload, better debug output.
* - fast-reload, print queue structure, for output to the remote client.
* - fast-reload, move print items to print queue from fast_reload_thread struct.
* - fast-reload, keep list of pending print queue items in daemon struct.
* - fast-reload, comment explains in_list for printq to print remainder.
* - fast-reload, unit test testdata/fast_reload_thread.tdir that tests the
thread output.
* - fast-reload, fix test link for fast_reload_printq_list_delete function.
* - fast-reload, reread config file from disk.
* - fast-reload, unshare forwards, making the structure locked, with an rwlock.
* - fast-reload, for nonthreaded, the unbound-control commands forward,
forward_add and forward_delete should be distributed to other processes,
but when threaded, they should not be distributed to other threads because
the structure is not thread specific any more.
* - fast-reload, unshared stub hints, making the structure locked, with an rwlock.
* - fast-reload, helpful comments for hints lookup function return value.
* - fast-reload, fix bug in fast reload printout, the strlist appendlist routine,
and printout time statistics after the reload is done.
* - fast-reload, keep track of reloadtime and deletestime and print them.
* - fast-reload, keep track of constructtime and print it.
* - fast-reload, construct new items.
* - fast-reload, better comment.
* - fast-reload, reload the config and swap trees for forwards and stub hints.
* - fast-reload, in forwards_swap_tree set protection of trees with locks.
* - fast-reload, in hints_swap_tree also swap the node count of the trees.
* - fast-reload, reload ipc to stop and start threads.
* - fast-reload, unused forward declarations removed.
* - fast-reload, unit test that fast reload works with forwards and stubs.
* - fast-reload, fix clang analyzer warnings.
* - fast-reload, small documentation entry in unbound-control -h output.
* - fast-reload, printout memory use by fast reload, in bytes.
* - fast-reload, compile without threads.
* - fast-reload, document fast_reload in man page.
* - fast-reload, print ok when done successfully.
* - fast-reload, option for fast-reload commandline, +v verbosity option,
with timing and memory use output.
* - fast-reload, option for fast-reload commandline, +p does not pause threads.
* - fast-reload, option for fast-reload commandline, +d drops mesh queries.
* - fast-reload, fix to poll every thread with nopause to make certain that
resources are not held by the threads and can be deleted.
* - fast-reload, fix to use atomic store for config variables with nopause.
* - fast-reload, reload views.
* - fast-reload, when tag defines are different, it drops the queries.
* - fast-reload, fix tag define check.
* - fast-reload, document that tag change causes drop of queries.
* - fast-reload, fix space in documentation man page.
* - fast-reload, copy respip client information to query state, put views tree
in module env for lookup.
* - fast-reload, nicer respip view comparison.
* - fast-reload, respip global set is in module env.
* - fast-reload, document that respip_client_info acl info is copied.
* - fast-reload, reload the respip_set.
* - fast-reload, document no pause and pick up of use_response_ip boolean.
* - fast-reload, fix test compile.
* - fast-reload, reload local zones.
* Update locking management for iter_fwd and iter_hints methods. (#1054)
fast reload, move most of the locking management to iter_fwd and
iter_hints methods. The caller still has the ability to handle its
own locking, if desired, for atomic operations on sets of different
structs.
Co-authored-by: Wouter Wijngaards <wcawijngaards@users.noreply.github.com>
* - fast-reload, reload access-control.
* - fast-reload, reload access control interface, such as interface-action.
* - fast-reload, reload tcp-connection-limit.
* - fast-reload, improve comments on acl_list and tcl_list swap tree.
* - fast-reload, fixup references to old tcp connection limits in open tcp
connections.
* - fast-reload, fixup to clean tcp connection also for different linked order.
* - fast-reload, if no tcp connection limits existed, no need to remove
references for that.
* - fast-reload, document more options that work and do not work.
* - fast-reload, reload auth_zone and rpz data.
* - fast-reload, fix auth_zones_get_mem.
* - fast-reload, fix compilation of testbound for the new comm_timer_get_mem
reference in remote control.
* - fast-reload, change use_rpz with reload.
* - fast-reload, list changes in auth zones and stop zonemd callbacks for
deleted auth zones.
* - fast-reload, note xtree is not swapped, and why it is not swapped.
* - fast-reload, for added auth zones, pick up zone transfer and zonemd tasks.
* - fast-reload, unlock xfr when done with transfer pick up.
* - fast-reload, unlock z when picking up the xfr for it during transfer task
pick up.
* - fast-reload, pick up task changes for added, deleted and modified auth zones.
* - fast-reload, remove xfr of auth zone deletion without tasks.
* - fast-reload, pick up zone transfer config.
* - fast-reload, the main worker thread picks up the transfer tasks and also
performs setup of the xfer struct.
* - fast-reload, keep writelock on newzone when auth zone changes.
* - fast-reload, change cachedb_enabled setting.
* - fast-reload, pick up edns-strings config.
* - fast-reload, note that settings are not updated.
* - fast-reload, pick up dnstap config.
* - fast-reload, dnstap options that need to be loaded without +p.
* - fast-reload, fix auth zone reload
* - fast-reload, remove debug for auth zone test.
* - fast-reload, fix auth zone reload with zone transfer.
* - fast-reload, fix auth zone reload lock order.
* - fast-reload, remove debug from fast reload test.
* - fast-reload, remove unused function.
* - fast-reload, fix the worker trust anchor probe timer lock acquisition in
the probe answer callback routine for trust anchor probes.
* - fast-reload, reload trust anchors.
* - fast-reload, fix trust anchor reload lock on autr global data and test
for trust anchor reload.
* - fast-reload, adjust cache sizes.
* - fast-reload, reload cache sizes when changed.
* - fast-reload, reload validator env changes.
* - fast-reload, reload mesh changes.
* - fast-reload, check for incompatible changes.
* - fast-reload, improve error text for incompatible change.
* - fast-reload, fix check config option compatibility.
* - fast-reload, improve error text for nopause change.
* - fast-reload, fix spelling of incompatible options.
* - fast-reload, reload target-fetch-policy, outbound-msg-retry, max-sent-count
and max-query-restarts.
* - fast-reload, check nopause config change for target-fetch-policy.
* - fast-reload, reload do-not-query-address, private-address and capt-exempt.
* - fast-reload, check nopause config change for do-not-query-address,
private-address and capt-exempt.
* - fast-reload, check fast reload not possible due to interface and
outgoing-interface changes.
* - fast-reload, reload nat64 settings.
* - fast-reload, reload settings stored in the infra structure.
* - fast-reload, fix modstack lookup and remove outgoing-range check.
* - fast-reload, more explanation for config parse failure.
* - fast-reload, reload worker outside network changes.
* - fast-reload, detect incompatible changes in network settings.
* fast-reload, commit test files.
* - fast-reload, fix warnings for call types in windows compile.
* - fast-reload, fix warnings and comm_point_internal for tcp wouldblock calls.
* - fast-reload, extend lock checks for repeat thread ids.
* - fast-reload, additional test cases, cache change and tag changes.
* - fast-reload, fix documentation for auth_zone_verify_zonemd_with_key.
* - fast-reload, fix copy_cfg type casts and memory leak on config parse failure.
* - fast-reload, fix use of WSAPoll.
* Review comments for the fast reload feature (#1259)
* - fast-reload review, respip set can be null from a view.
* - fast-reload review, typos.
* - fast-reload review, keep clang static analyzer happy.
* - fast-reload review, don't forget to copy tag_actions.
* - fast-reload review, less indentation.
* - fast-reload review, don't leak respip_actions when reloading.
* - fast-reload review, protect NULL pointer dereference in get_mem
functions.
* - fast-reload review, add fast_reload_most_options.tdir to test most
options with high verbosity when fast reloading.
* - fast-reload review, don't skip new line on long error printouts.
* - fast-reload review, typo.
* - fast-reload review, use new_z for consistency.
* - fast-reload review, nit for unlock ordering to make eye comparison
with the lock counterpart easier.
* - fast-reload review, in case of error the sockets are already closed.
* - fast-reload review, identation.
* - fast-reload review, add static keywords.
* - fast-reload review, update unbound-control usage text.
* - fast-reload review, updates to the man page.
* - fast-reload, the fast-reload command is experimental.
* - fast-reload, fix compile of doqclient for fast reload functions.
* Changelog comment for #1042
- Merge #1042: Fast Reload. The unbound-control fast_reload is added.
It reads changed config in a thread, then only briefly pauses the
service threads, that keep running. DNS service is only interrupted
briefly, less than a second.
---------
Co-authored-by: Yorgos Thessalonikefs <yorgos@nlnetlabs.nl>
2025-03-31 09:25:24 -04:00
|
|
|
if (!cfg->dnstap_send_version) {
|
|
|
|
|
free(env->version);
|
|
|
|
|
env->version = NULL;
|
2014-08-05 03:57:52 -04:00
|
|
|
return;
|
Fast Reload Option (#1042)
* - fast-reload, add unbound-control fast_reload
* - fast-reload, make a thread to service the unbound-control command.
* - fast-reload, communication sockets for information transfer.
* - fast-reload, fix compile for unbound-dnstap-socket.
* - fast-reload, set nonblocking communication to keep the server thread
responding to DNS requests.
* - fast-reload, poll routine to test for readiness, timeout fails connection.
* - fast-reload, detect loop in sock_poll_timeout routine.
* - fast-reload, send done and exited notification.
* - fast-reload, defines for constants in ipc.
* - fast-reload, ipc socket recv and send resists partial reads and writes and
can continue byte by byte. Also it can continue after an interrupt.
* - fast-reload, send exit command to thread when done.
* - fast-reload, output strings for client on string list.
* - fast-reload, add newline to terminal output.
* - fast-reload, send client string to remote client.
* - fast-reload, better debug output.
* - fast-reload, print queue structure, for output to the remote client.
* - fast-reload, move print items to print queue from fast_reload_thread struct.
* - fast-reload, keep list of pending print queue items in daemon struct.
* - fast-reload, comment explains in_list for printq to print remainder.
* - fast-reload, unit test testdata/fast_reload_thread.tdir that tests the
thread output.
* - fast-reload, fix test link for fast_reload_printq_list_delete function.
* - fast-reload, reread config file from disk.
* - fast-reload, unshare forwards, making the structure locked, with an rwlock.
* - fast-reload, for nonthreaded, the unbound-control commands forward,
forward_add and forward_delete should be distributed to other processes,
but when threaded, they should not be distributed to other threads because
the structure is not thread specific any more.
* - fast-reload, unshared stub hints, making the structure locked, with an rwlock.
* - fast-reload, helpful comments for hints lookup function return value.
* - fast-reload, fix bug in fast reload printout, the strlist appendlist routine,
and printout time statistics after the reload is done.
* - fast-reload, keep track of reloadtime and deletestime and print them.
* - fast-reload, keep track of constructtime and print it.
* - fast-reload, construct new items.
* - fast-reload, better comment.
* - fast-reload, reload the config and swap trees for forwards and stub hints.
* - fast-reload, in forwards_swap_tree set protection of trees with locks.
* - fast-reload, in hints_swap_tree also swap the node count of the trees.
* - fast-reload, reload ipc to stop and start threads.
* - fast-reload, unused forward declarations removed.
* - fast-reload, unit test that fast reload works with forwards and stubs.
* - fast-reload, fix clang analyzer warnings.
* - fast-reload, small documentation entry in unbound-control -h output.
* - fast-reload, printout memory use by fast reload, in bytes.
* - fast-reload, compile without threads.
* - fast-reload, document fast_reload in man page.
* - fast-reload, print ok when done successfully.
* - fast-reload, option for fast-reload commandline, +v verbosity option,
with timing and memory use output.
* - fast-reload, option for fast-reload commandline, +p does not pause threads.
* - fast-reload, option for fast-reload commandline, +d drops mesh queries.
* - fast-reload, fix to poll every thread with nopause to make certain that
resources are not held by the threads and can be deleted.
* - fast-reload, fix to use atomic store for config variables with nopause.
* - fast-reload, reload views.
* - fast-reload, when tag defines are different, it drops the queries.
* - fast-reload, fix tag define check.
* - fast-reload, document that tag change causes drop of queries.
* - fast-reload, fix space in documentation man page.
* - fast-reload, copy respip client information to query state, put views tree
in module env for lookup.
* - fast-reload, nicer respip view comparison.
* - fast-reload, respip global set is in module env.
* - fast-reload, document that respip_client_info acl info is copied.
* - fast-reload, reload the respip_set.
* - fast-reload, document no pause and pick up of use_response_ip boolean.
* - fast-reload, fix test compile.
* - fast-reload, reload local zones.
* Update locking management for iter_fwd and iter_hints methods. (#1054)
fast reload, move most of the locking management to iter_fwd and
iter_hints methods. The caller still has the ability to handle its
own locking, if desired, for atomic operations on sets of different
structs.
Co-authored-by: Wouter Wijngaards <wcawijngaards@users.noreply.github.com>
* - fast-reload, reload access-control.
* - fast-reload, reload access control interface, such as interface-action.
* - fast-reload, reload tcp-connection-limit.
* - fast-reload, improve comments on acl_list and tcl_list swap tree.
* - fast-reload, fixup references to old tcp connection limits in open tcp
connections.
* - fast-reload, fixup to clean tcp connection also for different linked order.
* - fast-reload, if no tcp connection limits existed, no need to remove
references for that.
* - fast-reload, document more options that work and do not work.
* - fast-reload, reload auth_zone and rpz data.
* - fast-reload, fix auth_zones_get_mem.
* - fast-reload, fix compilation of testbound for the new comm_timer_get_mem
reference in remote control.
* - fast-reload, change use_rpz with reload.
* - fast-reload, list changes in auth zones and stop zonemd callbacks for
deleted auth zones.
* - fast-reload, note xtree is not swapped, and why it is not swapped.
* - fast-reload, for added auth zones, pick up zone transfer and zonemd tasks.
* - fast-reload, unlock xfr when done with transfer pick up.
* - fast-reload, unlock z when picking up the xfr for it during transfer task
pick up.
* - fast-reload, pick up task changes for added, deleted and modified auth zones.
* - fast-reload, remove xfr of auth zone deletion without tasks.
* - fast-reload, pick up zone transfer config.
* - fast-reload, the main worker thread picks up the transfer tasks and also
performs setup of the xfer struct.
* - fast-reload, keep writelock on newzone when auth zone changes.
* - fast-reload, change cachedb_enabled setting.
* - fast-reload, pick up edns-strings config.
* - fast-reload, note that settings are not updated.
* - fast-reload, pick up dnstap config.
* - fast-reload, dnstap options that need to be loaded without +p.
* - fast-reload, fix auth zone reload
* - fast-reload, remove debug for auth zone test.
* - fast-reload, fix auth zone reload with zone transfer.
* - fast-reload, fix auth zone reload lock order.
* - fast-reload, remove debug from fast reload test.
* - fast-reload, remove unused function.
* - fast-reload, fix the worker trust anchor probe timer lock acquisition in
the probe answer callback routine for trust anchor probes.
* - fast-reload, reload trust anchors.
* - fast-reload, fix trust anchor reload lock on autr global data and test
for trust anchor reload.
* - fast-reload, adjust cache sizes.
* - fast-reload, reload cache sizes when changed.
* - fast-reload, reload validator env changes.
* - fast-reload, reload mesh changes.
* - fast-reload, check for incompatible changes.
* - fast-reload, improve error text for incompatible change.
* - fast-reload, fix check config option compatibility.
* - fast-reload, improve error text for nopause change.
* - fast-reload, fix spelling of incompatible options.
* - fast-reload, reload target-fetch-policy, outbound-msg-retry, max-sent-count
and max-query-restarts.
* - fast-reload, check nopause config change for target-fetch-policy.
* - fast-reload, reload do-not-query-address, private-address and capt-exempt.
* - fast-reload, check nopause config change for do-not-query-address,
private-address and capt-exempt.
* - fast-reload, check fast reload not possible due to interface and
outgoing-interface changes.
* - fast-reload, reload nat64 settings.
* - fast-reload, reload settings stored in the infra structure.
* - fast-reload, fix modstack lookup and remove outgoing-range check.
* - fast-reload, more explanation for config parse failure.
* - fast-reload, reload worker outside network changes.
* - fast-reload, detect incompatible changes in network settings.
* fast-reload, commit test files.
* - fast-reload, fix warnings for call types in windows compile.
* - fast-reload, fix warnings and comm_point_internal for tcp wouldblock calls.
* - fast-reload, extend lock checks for repeat thread ids.
* - fast-reload, additional test cases, cache change and tag changes.
* - fast-reload, fix documentation for auth_zone_verify_zonemd_with_key.
* - fast-reload, fix copy_cfg type casts and memory leak on config parse failure.
* - fast-reload, fix use of WSAPoll.
* Review comments for the fast reload feature (#1259)
* - fast-reload review, respip set can be null from a view.
* - fast-reload review, typos.
* - fast-reload review, keep clang static analyzer happy.
* - fast-reload review, don't forget to copy tag_actions.
* - fast-reload review, less indentation.
* - fast-reload review, don't leak respip_actions when reloading.
* - fast-reload review, protect NULL pointer dereference in get_mem
functions.
* - fast-reload review, add fast_reload_most_options.tdir to test most
options with high verbosity when fast reloading.
* - fast-reload review, don't skip new line on long error printouts.
* - fast-reload review, typo.
* - fast-reload review, use new_z for consistency.
* - fast-reload review, nit for unlock ordering to make eye comparison
with the lock counterpart easier.
* - fast-reload review, in case of error the sockets are already closed.
* - fast-reload review, identation.
* - fast-reload review, add static keywords.
* - fast-reload review, update unbound-control usage text.
* - fast-reload review, updates to the man page.
* - fast-reload, the fast-reload command is experimental.
* - fast-reload, fix compile of doqclient for fast reload functions.
* Changelog comment for #1042
- Merge #1042: Fast Reload. The unbound-control fast_reload is added.
It reads changed config in a thread, then only briefly pauses the
service threads, that keep running. DNS service is only interrupted
briefly, less than a second.
---------
Co-authored-by: Yorgos Thessalonikefs <yorgos@nlnetlabs.nl>
2025-03-31 09:25:24 -04:00
|
|
|
}
|
2014-08-05 03:57:52 -04:00
|
|
|
free(env->version);
|
|
|
|
|
if (cfg->dnstap_version == NULL || cfg->dnstap_version[0] == 0)
|
|
|
|
|
env->version = strdup(PACKAGE_STRING);
|
|
|
|
|
else
|
|
|
|
|
env->version = strdup(cfg->dnstap_version);
|
|
|
|
|
if (env->version == NULL)
|
|
|
|
|
fatal_exit("dt_apply_version: strdup() failed");
|
2014-08-18 10:42:26 -04:00
|
|
|
env->len_version = (unsigned int)strlen(env->version);
|
2014-08-05 03:57:52 -04:00
|
|
|
verbose(VERB_OPS, "dnstap version field set to \"%s\"",
|
|
|
|
|
env->version);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
Fast Reload Option (#1042)
* - fast-reload, add unbound-control fast_reload
* - fast-reload, make a thread to service the unbound-control command.
* - fast-reload, communication sockets for information transfer.
* - fast-reload, fix compile for unbound-dnstap-socket.
* - fast-reload, set nonblocking communication to keep the server thread
responding to DNS requests.
* - fast-reload, poll routine to test for readiness, timeout fails connection.
* - fast-reload, detect loop in sock_poll_timeout routine.
* - fast-reload, send done and exited notification.
* - fast-reload, defines for constants in ipc.
* - fast-reload, ipc socket recv and send resists partial reads and writes and
can continue byte by byte. Also it can continue after an interrupt.
* - fast-reload, send exit command to thread when done.
* - fast-reload, output strings for client on string list.
* - fast-reload, add newline to terminal output.
* - fast-reload, send client string to remote client.
* - fast-reload, better debug output.
* - fast-reload, print queue structure, for output to the remote client.
* - fast-reload, move print items to print queue from fast_reload_thread struct.
* - fast-reload, keep list of pending print queue items in daemon struct.
* - fast-reload, comment explains in_list for printq to print remainder.
* - fast-reload, unit test testdata/fast_reload_thread.tdir that tests the
thread output.
* - fast-reload, fix test link for fast_reload_printq_list_delete function.
* - fast-reload, reread config file from disk.
* - fast-reload, unshare forwards, making the structure locked, with an rwlock.
* - fast-reload, for nonthreaded, the unbound-control commands forward,
forward_add and forward_delete should be distributed to other processes,
but when threaded, they should not be distributed to other threads because
the structure is not thread specific any more.
* - fast-reload, unshared stub hints, making the structure locked, with an rwlock.
* - fast-reload, helpful comments for hints lookup function return value.
* - fast-reload, fix bug in fast reload printout, the strlist appendlist routine,
and printout time statistics after the reload is done.
* - fast-reload, keep track of reloadtime and deletestime and print them.
* - fast-reload, keep track of constructtime and print it.
* - fast-reload, construct new items.
* - fast-reload, better comment.
* - fast-reload, reload the config and swap trees for forwards and stub hints.
* - fast-reload, in forwards_swap_tree set protection of trees with locks.
* - fast-reload, in hints_swap_tree also swap the node count of the trees.
* - fast-reload, reload ipc to stop and start threads.
* - fast-reload, unused forward declarations removed.
* - fast-reload, unit test that fast reload works with forwards and stubs.
* - fast-reload, fix clang analyzer warnings.
* - fast-reload, small documentation entry in unbound-control -h output.
* - fast-reload, printout memory use by fast reload, in bytes.
* - fast-reload, compile without threads.
* - fast-reload, document fast_reload in man page.
* - fast-reload, print ok when done successfully.
* - fast-reload, option for fast-reload commandline, +v verbosity option,
with timing and memory use output.
* - fast-reload, option for fast-reload commandline, +p does not pause threads.
* - fast-reload, option for fast-reload commandline, +d drops mesh queries.
* - fast-reload, fix to poll every thread with nopause to make certain that
resources are not held by the threads and can be deleted.
* - fast-reload, fix to use atomic store for config variables with nopause.
* - fast-reload, reload views.
* - fast-reload, when tag defines are different, it drops the queries.
* - fast-reload, fix tag define check.
* - fast-reload, document that tag change causes drop of queries.
* - fast-reload, fix space in documentation man page.
* - fast-reload, copy respip client information to query state, put views tree
in module env for lookup.
* - fast-reload, nicer respip view comparison.
* - fast-reload, respip global set is in module env.
* - fast-reload, document that respip_client_info acl info is copied.
* - fast-reload, reload the respip_set.
* - fast-reload, document no pause and pick up of use_response_ip boolean.
* - fast-reload, fix test compile.
* - fast-reload, reload local zones.
* Update locking management for iter_fwd and iter_hints methods. (#1054)
fast reload, move most of the locking management to iter_fwd and
iter_hints methods. The caller still has the ability to handle its
own locking, if desired, for atomic operations on sets of different
structs.
Co-authored-by: Wouter Wijngaards <wcawijngaards@users.noreply.github.com>
* - fast-reload, reload access-control.
* - fast-reload, reload access control interface, such as interface-action.
* - fast-reload, reload tcp-connection-limit.
* - fast-reload, improve comments on acl_list and tcl_list swap tree.
* - fast-reload, fixup references to old tcp connection limits in open tcp
connections.
* - fast-reload, fixup to clean tcp connection also for different linked order.
* - fast-reload, if no tcp connection limits existed, no need to remove
references for that.
* - fast-reload, document more options that work and do not work.
* - fast-reload, reload auth_zone and rpz data.
* - fast-reload, fix auth_zones_get_mem.
* - fast-reload, fix compilation of testbound for the new comm_timer_get_mem
reference in remote control.
* - fast-reload, change use_rpz with reload.
* - fast-reload, list changes in auth zones and stop zonemd callbacks for
deleted auth zones.
* - fast-reload, note xtree is not swapped, and why it is not swapped.
* - fast-reload, for added auth zones, pick up zone transfer and zonemd tasks.
* - fast-reload, unlock xfr when done with transfer pick up.
* - fast-reload, unlock z when picking up the xfr for it during transfer task
pick up.
* - fast-reload, pick up task changes for added, deleted and modified auth zones.
* - fast-reload, remove xfr of auth zone deletion without tasks.
* - fast-reload, pick up zone transfer config.
* - fast-reload, the main worker thread picks up the transfer tasks and also
performs setup of the xfer struct.
* - fast-reload, keep writelock on newzone when auth zone changes.
* - fast-reload, change cachedb_enabled setting.
* - fast-reload, pick up edns-strings config.
* - fast-reload, note that settings are not updated.
* - fast-reload, pick up dnstap config.
* - fast-reload, dnstap options that need to be loaded without +p.
* - fast-reload, fix auth zone reload
* - fast-reload, remove debug for auth zone test.
* - fast-reload, fix auth zone reload with zone transfer.
* - fast-reload, fix auth zone reload lock order.
* - fast-reload, remove debug from fast reload test.
* - fast-reload, remove unused function.
* - fast-reload, fix the worker trust anchor probe timer lock acquisition in
the probe answer callback routine for trust anchor probes.
* - fast-reload, reload trust anchors.
* - fast-reload, fix trust anchor reload lock on autr global data and test
for trust anchor reload.
* - fast-reload, adjust cache sizes.
* - fast-reload, reload cache sizes when changed.
* - fast-reload, reload validator env changes.
* - fast-reload, reload mesh changes.
* - fast-reload, check for incompatible changes.
* - fast-reload, improve error text for incompatible change.
* - fast-reload, fix check config option compatibility.
* - fast-reload, improve error text for nopause change.
* - fast-reload, fix spelling of incompatible options.
* - fast-reload, reload target-fetch-policy, outbound-msg-retry, max-sent-count
and max-query-restarts.
* - fast-reload, check nopause config change for target-fetch-policy.
* - fast-reload, reload do-not-query-address, private-address and capt-exempt.
* - fast-reload, check nopause config change for do-not-query-address,
private-address and capt-exempt.
* - fast-reload, check fast reload not possible due to interface and
outgoing-interface changes.
* - fast-reload, reload nat64 settings.
* - fast-reload, reload settings stored in the infra structure.
* - fast-reload, fix modstack lookup and remove outgoing-range check.
* - fast-reload, more explanation for config parse failure.
* - fast-reload, reload worker outside network changes.
* - fast-reload, detect incompatible changes in network settings.
* fast-reload, commit test files.
* - fast-reload, fix warnings for call types in windows compile.
* - fast-reload, fix warnings and comm_point_internal for tcp wouldblock calls.
* - fast-reload, extend lock checks for repeat thread ids.
* - fast-reload, additional test cases, cache change and tag changes.
* - fast-reload, fix documentation for auth_zone_verify_zonemd_with_key.
* - fast-reload, fix copy_cfg type casts and memory leak on config parse failure.
* - fast-reload, fix use of WSAPoll.
* Review comments for the fast reload feature (#1259)
* - fast-reload review, respip set can be null from a view.
* - fast-reload review, typos.
* - fast-reload review, keep clang static analyzer happy.
* - fast-reload review, don't forget to copy tag_actions.
* - fast-reload review, less indentation.
* - fast-reload review, don't leak respip_actions when reloading.
* - fast-reload review, protect NULL pointer dereference in get_mem
functions.
* - fast-reload review, add fast_reload_most_options.tdir to test most
options with high verbosity when fast reloading.
* - fast-reload review, don't skip new line on long error printouts.
* - fast-reload review, typo.
* - fast-reload review, use new_z for consistency.
* - fast-reload review, nit for unlock ordering to make eye comparison
with the lock counterpart easier.
* - fast-reload review, in case of error the sockets are already closed.
* - fast-reload review, identation.
* - fast-reload review, add static keywords.
* - fast-reload review, update unbound-control usage text.
* - fast-reload review, updates to the man page.
* - fast-reload, the fast-reload command is experimental.
* - fast-reload, fix compile of doqclient for fast reload functions.
* Changelog comment for #1042
- Merge #1042: Fast Reload. The unbound-control fast_reload is added.
It reads changed config in a thread, then only briefly pauses the
service threads, that keep running. DNS service is only interrupted
briefly, less than a second.
---------
Co-authored-by: Yorgos Thessalonikefs <yorgos@nlnetlabs.nl>
2025-03-31 09:25:24 -04:00
|
|
|
dt_apply_logcfg(struct dt_env *env, struct config_file *cfg)
|
2014-08-05 03:57:52 -04:00
|
|
|
{
|
2014-08-18 10:42:26 -04:00
|
|
|
if ((env->log_resolver_query_messages = (unsigned int)
|
2014-08-05 03:57:52 -04:00
|
|
|
cfg->dnstap_log_resolver_query_messages))
|
|
|
|
|
{
|
|
|
|
|
verbose(VERB_OPS, "dnstap Message/RESOLVER_QUERY enabled");
|
|
|
|
|
}
|
2014-08-18 10:42:26 -04:00
|
|
|
if ((env->log_resolver_response_messages = (unsigned int)
|
2014-08-05 03:57:52 -04:00
|
|
|
cfg->dnstap_log_resolver_response_messages))
|
|
|
|
|
{
|
|
|
|
|
verbose(VERB_OPS, "dnstap Message/RESOLVER_RESPONSE enabled");
|
|
|
|
|
}
|
2014-08-18 10:42:26 -04:00
|
|
|
if ((env->log_client_query_messages = (unsigned int)
|
2014-08-05 03:57:52 -04:00
|
|
|
cfg->dnstap_log_client_query_messages))
|
|
|
|
|
{
|
|
|
|
|
verbose(VERB_OPS, "dnstap Message/CLIENT_QUERY enabled");
|
|
|
|
|
}
|
2014-08-18 10:42:26 -04:00
|
|
|
if ((env->log_client_response_messages = (unsigned int)
|
2014-08-05 03:57:52 -04:00
|
|
|
cfg->dnstap_log_client_response_messages))
|
|
|
|
|
{
|
|
|
|
|
verbose(VERB_OPS, "dnstap Message/CLIENT_RESPONSE enabled");
|
|
|
|
|
}
|
2014-08-18 10:42:26 -04:00
|
|
|
if ((env->log_forwarder_query_messages = (unsigned int)
|
2014-08-05 03:57:52 -04:00
|
|
|
cfg->dnstap_log_forwarder_query_messages))
|
|
|
|
|
{
|
|
|
|
|
verbose(VERB_OPS, "dnstap Message/FORWARDER_QUERY enabled");
|
|
|
|
|
}
|
2014-08-18 10:42:26 -04:00
|
|
|
if ((env->log_forwarder_response_messages = (unsigned int)
|
2014-08-05 03:57:52 -04:00
|
|
|
cfg->dnstap_log_forwarder_response_messages))
|
|
|
|
|
{
|
|
|
|
|
verbose(VERB_OPS, "dnstap Message/FORWARDER_RESPONSE enabled");
|
|
|
|
|
}
|
2024-07-19 04:04:40 -04:00
|
|
|
lock_basic_lock(&env->sample_lock);
|
|
|
|
|
if((env->sample_rate = (unsigned int)cfg->dnstap_sample_rate))
|
|
|
|
|
{
|
|
|
|
|
verbose(VERB_OPS, "dnstap SAMPLE_RATE enabled and set to \"%d\"", (int)env->sample_rate);
|
|
|
|
|
}
|
|
|
|
|
lock_basic_unlock(&env->sample_lock);
|
2014-08-05 03:57:52 -04:00
|
|
|
}
|
|
|
|
|
|
Fast Reload Option (#1042)
* - fast-reload, add unbound-control fast_reload
* - fast-reload, make a thread to service the unbound-control command.
* - fast-reload, communication sockets for information transfer.
* - fast-reload, fix compile for unbound-dnstap-socket.
* - fast-reload, set nonblocking communication to keep the server thread
responding to DNS requests.
* - fast-reload, poll routine to test for readiness, timeout fails connection.
* - fast-reload, detect loop in sock_poll_timeout routine.
* - fast-reload, send done and exited notification.
* - fast-reload, defines for constants in ipc.
* - fast-reload, ipc socket recv and send resists partial reads and writes and
can continue byte by byte. Also it can continue after an interrupt.
* - fast-reload, send exit command to thread when done.
* - fast-reload, output strings for client on string list.
* - fast-reload, add newline to terminal output.
* - fast-reload, send client string to remote client.
* - fast-reload, better debug output.
* - fast-reload, print queue structure, for output to the remote client.
* - fast-reload, move print items to print queue from fast_reload_thread struct.
* - fast-reload, keep list of pending print queue items in daemon struct.
* - fast-reload, comment explains in_list for printq to print remainder.
* - fast-reload, unit test testdata/fast_reload_thread.tdir that tests the
thread output.
* - fast-reload, fix test link for fast_reload_printq_list_delete function.
* - fast-reload, reread config file from disk.
* - fast-reload, unshare forwards, making the structure locked, with an rwlock.
* - fast-reload, for nonthreaded, the unbound-control commands forward,
forward_add and forward_delete should be distributed to other processes,
but when threaded, they should not be distributed to other threads because
the structure is not thread specific any more.
* - fast-reload, unshared stub hints, making the structure locked, with an rwlock.
* - fast-reload, helpful comments for hints lookup function return value.
* - fast-reload, fix bug in fast reload printout, the strlist appendlist routine,
and printout time statistics after the reload is done.
* - fast-reload, keep track of reloadtime and deletestime and print them.
* - fast-reload, keep track of constructtime and print it.
* - fast-reload, construct new items.
* - fast-reload, better comment.
* - fast-reload, reload the config and swap trees for forwards and stub hints.
* - fast-reload, in forwards_swap_tree set protection of trees with locks.
* - fast-reload, in hints_swap_tree also swap the node count of the trees.
* - fast-reload, reload ipc to stop and start threads.
* - fast-reload, unused forward declarations removed.
* - fast-reload, unit test that fast reload works with forwards and stubs.
* - fast-reload, fix clang analyzer warnings.
* - fast-reload, small documentation entry in unbound-control -h output.
* - fast-reload, printout memory use by fast reload, in bytes.
* - fast-reload, compile without threads.
* - fast-reload, document fast_reload in man page.
* - fast-reload, print ok when done successfully.
* - fast-reload, option for fast-reload commandline, +v verbosity option,
with timing and memory use output.
* - fast-reload, option for fast-reload commandline, +p does not pause threads.
* - fast-reload, option for fast-reload commandline, +d drops mesh queries.
* - fast-reload, fix to poll every thread with nopause to make certain that
resources are not held by the threads and can be deleted.
* - fast-reload, fix to use atomic store for config variables with nopause.
* - fast-reload, reload views.
* - fast-reload, when tag defines are different, it drops the queries.
* - fast-reload, fix tag define check.
* - fast-reload, document that tag change causes drop of queries.
* - fast-reload, fix space in documentation man page.
* - fast-reload, copy respip client information to query state, put views tree
in module env for lookup.
* - fast-reload, nicer respip view comparison.
* - fast-reload, respip global set is in module env.
* - fast-reload, document that respip_client_info acl info is copied.
* - fast-reload, reload the respip_set.
* - fast-reload, document no pause and pick up of use_response_ip boolean.
* - fast-reload, fix test compile.
* - fast-reload, reload local zones.
* Update locking management for iter_fwd and iter_hints methods. (#1054)
fast reload, move most of the locking management to iter_fwd and
iter_hints methods. The caller still has the ability to handle its
own locking, if desired, for atomic operations on sets of different
structs.
Co-authored-by: Wouter Wijngaards <wcawijngaards@users.noreply.github.com>
* - fast-reload, reload access-control.
* - fast-reload, reload access control interface, such as interface-action.
* - fast-reload, reload tcp-connection-limit.
* - fast-reload, improve comments on acl_list and tcl_list swap tree.
* - fast-reload, fixup references to old tcp connection limits in open tcp
connections.
* - fast-reload, fixup to clean tcp connection also for different linked order.
* - fast-reload, if no tcp connection limits existed, no need to remove
references for that.
* - fast-reload, document more options that work and do not work.
* - fast-reload, reload auth_zone and rpz data.
* - fast-reload, fix auth_zones_get_mem.
* - fast-reload, fix compilation of testbound for the new comm_timer_get_mem
reference in remote control.
* - fast-reload, change use_rpz with reload.
* - fast-reload, list changes in auth zones and stop zonemd callbacks for
deleted auth zones.
* - fast-reload, note xtree is not swapped, and why it is not swapped.
* - fast-reload, for added auth zones, pick up zone transfer and zonemd tasks.
* - fast-reload, unlock xfr when done with transfer pick up.
* - fast-reload, unlock z when picking up the xfr for it during transfer task
pick up.
* - fast-reload, pick up task changes for added, deleted and modified auth zones.
* - fast-reload, remove xfr of auth zone deletion without tasks.
* - fast-reload, pick up zone transfer config.
* - fast-reload, the main worker thread picks up the transfer tasks and also
performs setup of the xfer struct.
* - fast-reload, keep writelock on newzone when auth zone changes.
* - fast-reload, change cachedb_enabled setting.
* - fast-reload, pick up edns-strings config.
* - fast-reload, note that settings are not updated.
* - fast-reload, pick up dnstap config.
* - fast-reload, dnstap options that need to be loaded without +p.
* - fast-reload, fix auth zone reload
* - fast-reload, remove debug for auth zone test.
* - fast-reload, fix auth zone reload with zone transfer.
* - fast-reload, fix auth zone reload lock order.
* - fast-reload, remove debug from fast reload test.
* - fast-reload, remove unused function.
* - fast-reload, fix the worker trust anchor probe timer lock acquisition in
the probe answer callback routine for trust anchor probes.
* - fast-reload, reload trust anchors.
* - fast-reload, fix trust anchor reload lock on autr global data and test
for trust anchor reload.
* - fast-reload, adjust cache sizes.
* - fast-reload, reload cache sizes when changed.
* - fast-reload, reload validator env changes.
* - fast-reload, reload mesh changes.
* - fast-reload, check for incompatible changes.
* - fast-reload, improve error text for incompatible change.
* - fast-reload, fix check config option compatibility.
* - fast-reload, improve error text for nopause change.
* - fast-reload, fix spelling of incompatible options.
* - fast-reload, reload target-fetch-policy, outbound-msg-retry, max-sent-count
and max-query-restarts.
* - fast-reload, check nopause config change for target-fetch-policy.
* - fast-reload, reload do-not-query-address, private-address and capt-exempt.
* - fast-reload, check nopause config change for do-not-query-address,
private-address and capt-exempt.
* - fast-reload, check fast reload not possible due to interface and
outgoing-interface changes.
* - fast-reload, reload nat64 settings.
* - fast-reload, reload settings stored in the infra structure.
* - fast-reload, fix modstack lookup and remove outgoing-range check.
* - fast-reload, more explanation for config parse failure.
* - fast-reload, reload worker outside network changes.
* - fast-reload, detect incompatible changes in network settings.
* fast-reload, commit test files.
* - fast-reload, fix warnings for call types in windows compile.
* - fast-reload, fix warnings and comm_point_internal for tcp wouldblock calls.
* - fast-reload, extend lock checks for repeat thread ids.
* - fast-reload, additional test cases, cache change and tag changes.
* - fast-reload, fix documentation for auth_zone_verify_zonemd_with_key.
* - fast-reload, fix copy_cfg type casts and memory leak on config parse failure.
* - fast-reload, fix use of WSAPoll.
* Review comments for the fast reload feature (#1259)
* - fast-reload review, respip set can be null from a view.
* - fast-reload review, typos.
* - fast-reload review, keep clang static analyzer happy.
* - fast-reload review, don't forget to copy tag_actions.
* - fast-reload review, less indentation.
* - fast-reload review, don't leak respip_actions when reloading.
* - fast-reload review, protect NULL pointer dereference in get_mem
functions.
* - fast-reload review, add fast_reload_most_options.tdir to test most
options with high verbosity when fast reloading.
* - fast-reload review, don't skip new line on long error printouts.
* - fast-reload review, typo.
* - fast-reload review, use new_z for consistency.
* - fast-reload review, nit for unlock ordering to make eye comparison
with the lock counterpart easier.
* - fast-reload review, in case of error the sockets are already closed.
* - fast-reload review, identation.
* - fast-reload review, add static keywords.
* - fast-reload review, update unbound-control usage text.
* - fast-reload review, updates to the man page.
* - fast-reload, the fast-reload command is experimental.
* - fast-reload, fix compile of doqclient for fast reload functions.
* Changelog comment for #1042
- Merge #1042: Fast Reload. The unbound-control fast_reload is added.
It reads changed config in a thread, then only briefly pauses the
service threads, that keep running. DNS service is only interrupted
briefly, less than a second.
---------
Co-authored-by: Yorgos Thessalonikefs <yorgos@nlnetlabs.nl>
2025-03-31 09:25:24 -04:00
|
|
|
void
|
|
|
|
|
dt_apply_cfg(struct dt_env *env, struct config_file *cfg)
|
|
|
|
|
{
|
|
|
|
|
if (!cfg->dnstap)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
dt_apply_identity(env, cfg);
|
|
|
|
|
dt_apply_version(env, cfg);
|
|
|
|
|
dt_apply_logcfg(env, cfg);
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 03:57:52 -04:00
|
|
|
int
|
2020-09-23 05:13:52 -04:00
|
|
|
dt_init(struct dt_env *env, struct comm_base* base)
|
2014-08-05 03:57:52 -04:00
|
|
|
{
|
2020-09-23 05:13:52 -04:00
|
|
|
env->msgqueue = dt_msg_queue_create(base);
|
2020-01-21 08:50:37 -05:00
|
|
|
if(!env->msgqueue) {
|
|
|
|
|
log_err("malloc failure");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2020-01-21 11:01:25 -05:00
|
|
|
if(!dt_io_thread_register_queue(env->dtio, env->msgqueue)) {
|
|
|
|
|
log_err("malloc failure");
|
2020-02-28 03:17:02 -05:00
|
|
|
dt_msg_queue_delete(env->msgqueue);
|
|
|
|
|
env->msgqueue = NULL;
|
2020-01-21 11:01:25 -05:00
|
|
|
return 0;
|
|
|
|
|
}
|
2014-08-05 03:57:52 -04:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-21 08:50:37 -05:00
|
|
|
void
|
|
|
|
|
dt_deinit(struct dt_env* env)
|
|
|
|
|
{
|
2020-01-21 11:01:25 -05:00
|
|
|
dt_io_thread_unregister_queue(env->dtio, env->msgqueue);
|
2020-01-21 08:50:37 -05:00
|
|
|
dt_msg_queue_delete(env->msgqueue);
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 03:57:52 -04:00
|
|
|
void
|
|
|
|
|
dt_delete(struct dt_env *env)
|
|
|
|
|
{
|
|
|
|
|
if (!env)
|
|
|
|
|
return;
|
2020-01-21 11:01:25 -05:00
|
|
|
dt_io_thread_delete(env->dtio);
|
2024-07-19 04:04:40 -04:00
|
|
|
lock_basic_destroy(&env->sample_lock);
|
2014-08-05 03:57:52 -04:00
|
|
|
free(env->identity);
|
|
|
|
|
free(env->version);
|
|
|
|
|
free(env);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dt_fill_timeval(const struct timeval *tv,
|
|
|
|
|
uint64_t *time_sec, protobuf_c_boolean *has_time_sec,
|
|
|
|
|
uint32_t *time_nsec, protobuf_c_boolean *has_time_nsec)
|
|
|
|
|
{
|
2014-08-18 10:42:26 -04:00
|
|
|
#ifndef S_SPLINT_S
|
2014-08-05 03:57:52 -04:00
|
|
|
*time_sec = tv->tv_sec;
|
|
|
|
|
*time_nsec = tv->tv_usec * 1000;
|
2014-08-18 10:42:26 -04:00
|
|
|
#endif
|
2014-08-05 03:57:52 -04:00
|
|
|
*has_time_sec = 1;
|
|
|
|
|
*has_time_nsec = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dt_fill_buffer(sldns_buffer *b, ProtobufCBinaryData *p, protobuf_c_boolean *has)
|
|
|
|
|
{
|
|
|
|
|
log_assert(b != NULL);
|
|
|
|
|
p->len = sldns_buffer_limit(b);
|
|
|
|
|
p->data = sldns_buffer_begin(b);
|
|
|
|
|
*has = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dt_msg_fill_net(struct dt_msg *dm,
|
2020-12-09 05:00:51 -05:00
|
|
|
struct sockaddr_storage *qs,
|
|
|
|
|
struct sockaddr_storage *rs,
|
2014-08-05 03:57:52 -04:00
|
|
|
enum comm_point_type cptype,
|
2023-12-26 17:26:21 -05:00
|
|
|
void *cpssl,
|
2020-12-09 05:00:51 -05:00
|
|
|
ProtobufCBinaryData *qaddr, protobuf_c_boolean *has_qaddr,
|
|
|
|
|
uint32_t *qport, protobuf_c_boolean *has_qport,
|
|
|
|
|
ProtobufCBinaryData *raddr, protobuf_c_boolean *has_raddr,
|
|
|
|
|
uint32_t *rport, protobuf_c_boolean *has_rport)
|
2014-08-05 03:57:52 -04:00
|
|
|
{
|
2020-12-09 05:00:51 -05:00
|
|
|
log_assert(qs->ss_family == AF_INET6 || qs->ss_family == AF_INET);
|
|
|
|
|
if (qs->ss_family == AF_INET6) {
|
|
|
|
|
struct sockaddr_in6 *q = (struct sockaddr_in6 *) qs;
|
2014-08-05 03:57:52 -04:00
|
|
|
|
|
|
|
|
/* socket_family */
|
|
|
|
|
dm->m.socket_family = DNSTAP__SOCKET_FAMILY__INET6;
|
|
|
|
|
dm->m.has_socket_family = 1;
|
|
|
|
|
|
|
|
|
|
/* addr: query_address or response_address */
|
2020-12-09 05:00:51 -05:00
|
|
|
qaddr->data = q->sin6_addr.s6_addr;
|
|
|
|
|
qaddr->len = 16; /* IPv6 */
|
|
|
|
|
*has_qaddr = 1;
|
2014-08-05 03:57:52 -04:00
|
|
|
|
|
|
|
|
/* port: query_port or response_port */
|
2020-12-09 05:00:51 -05:00
|
|
|
*qport = ntohs(q->sin6_port);
|
|
|
|
|
*has_qport = 1;
|
|
|
|
|
} else if (qs->ss_family == AF_INET) {
|
|
|
|
|
struct sockaddr_in *q = (struct sockaddr_in *) qs;
|
2014-08-05 03:57:52 -04:00
|
|
|
|
|
|
|
|
/* socket_family */
|
|
|
|
|
dm->m.socket_family = DNSTAP__SOCKET_FAMILY__INET;
|
|
|
|
|
dm->m.has_socket_family = 1;
|
|
|
|
|
|
|
|
|
|
/* addr: query_address or response_address */
|
2020-12-09 05:00:51 -05:00
|
|
|
qaddr->data = (uint8_t *) &q->sin_addr.s_addr;
|
|
|
|
|
qaddr->len = 4; /* IPv4 */
|
|
|
|
|
*has_qaddr = 1;
|
2014-08-05 03:57:52 -04:00
|
|
|
|
|
|
|
|
/* port: query_port or response_port */
|
2020-12-09 05:00:51 -05:00
|
|
|
*qport = ntohs(q->sin_port);
|
|
|
|
|
*has_qport = 1;
|
2014-08-05 03:57:52 -04:00
|
|
|
}
|
|
|
|
|
|
2020-12-09 05:00:51 -05:00
|
|
|
/*
|
|
|
|
|
* This block is to fill second set of fields in DNSTAP-message defined as request_/response_ names.
|
2020-12-09 05:13:58 -05:00
|
|
|
* Additional responsive structure is: struct sockaddr_storage *rs
|
2020-12-09 05:00:51 -05:00
|
|
|
*/
|
2020-12-09 07:52:49 -05:00
|
|
|
if (rs && rs->ss_family == AF_INET6) {
|
2020-12-09 05:00:51 -05:00
|
|
|
struct sockaddr_in6 *r = (struct sockaddr_in6 *) rs;
|
|
|
|
|
|
|
|
|
|
/* addr: query_address or response_address */
|
|
|
|
|
raddr->data = r->sin6_addr.s6_addr;
|
|
|
|
|
raddr->len = 16; /* IPv6 */
|
|
|
|
|
*has_raddr = 1;
|
|
|
|
|
|
|
|
|
|
/* port: query_port or response_port */
|
|
|
|
|
*rport = ntohs(r->sin6_port);
|
|
|
|
|
*has_rport = 1;
|
2020-12-09 07:52:49 -05:00
|
|
|
} else if (rs && rs->ss_family == AF_INET) {
|
2020-12-09 05:00:51 -05:00
|
|
|
struct sockaddr_in *r = (struct sockaddr_in *) rs;
|
|
|
|
|
|
|
|
|
|
/* addr: query_address or response_address */
|
|
|
|
|
raddr->data = (uint8_t *) &r->sin_addr.s_addr;
|
|
|
|
|
raddr->len = 4; /* IPv4 */
|
|
|
|
|
*has_raddr = 1;
|
|
|
|
|
|
|
|
|
|
/* port: query_port or response_port */
|
|
|
|
|
*rport = ntohs(r->sin_port);
|
|
|
|
|
*has_rport = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-05 03:57:52 -04:00
|
|
|
if (cptype == comm_udp) {
|
|
|
|
|
/* socket_protocol */
|
|
|
|
|
dm->m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__UDP;
|
|
|
|
|
dm->m.has_socket_protocol = 1;
|
|
|
|
|
} else if (cptype == comm_tcp) {
|
2023-12-26 17:26:21 -05:00
|
|
|
if (cpssl == NULL) {
|
|
|
|
|
/* socket_protocol */
|
|
|
|
|
dm->m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__TCP;
|
|
|
|
|
dm->m.has_socket_protocol = 1;
|
|
|
|
|
} else {
|
|
|
|
|
/* socket_protocol */
|
|
|
|
|
dm->m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__DOT;
|
|
|
|
|
dm->m.has_socket_protocol = 1;
|
|
|
|
|
}
|
|
|
|
|
} else if (cptype == comm_http) {
|
2014-08-05 03:57:52 -04:00
|
|
|
/* socket_protocol */
|
2023-12-26 17:26:21 -05:00
|
|
|
dm->m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__DOH;
|
2014-08-05 03:57:52 -04:00
|
|
|
dm->m.has_socket_protocol = 1;
|
2023-12-05 07:14:08 -05:00
|
|
|
} else {
|
|
|
|
|
/* other socket protocol */
|
|
|
|
|
dm->m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__TCP;
|
|
|
|
|
dm->m.has_socket_protocol = 1;
|
2014-08-05 03:57:52 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
dt_msg_send_client_query(struct dt_env *env,
|
|
|
|
|
struct sockaddr_storage *qsock,
|
2020-12-09 05:00:51 -05:00
|
|
|
struct sockaddr_storage *rsock,
|
2014-08-05 03:57:52 -04:00
|
|
|
enum comm_point_type cptype,
|
2023-12-26 17:26:21 -05:00
|
|
|
void *cpssl,
|
2023-05-16 02:50:38 -04:00
|
|
|
sldns_buffer *qmsg,
|
|
|
|
|
struct timeval* tstamp)
|
2014-08-05 03:57:52 -04:00
|
|
|
{
|
|
|
|
|
struct dt_msg dm;
|
|
|
|
|
struct timeval qtime;
|
|
|
|
|
|
2024-07-19 04:04:40 -04:00
|
|
|
if(dt_sample_rate_limited(env))
|
|
|
|
|
return;
|
|
|
|
|
|
2023-05-16 02:50:38 -04:00
|
|
|
if(tstamp)
|
|
|
|
|
memcpy(&qtime, tstamp, sizeof(qtime));
|
|
|
|
|
else gettimeofday(&qtime, NULL);
|
2014-08-05 03:57:52 -04:00
|
|
|
|
|
|
|
|
/* type */
|
|
|
|
|
dt_msg_init(env, &dm, DNSTAP__MESSAGE__TYPE__CLIENT_QUERY);
|
|
|
|
|
|
|
|
|
|
/* query_time */
|
|
|
|
|
dt_fill_timeval(&qtime,
|
|
|
|
|
&dm.m.query_time_sec, &dm.m.has_query_time_sec,
|
|
|
|
|
&dm.m.query_time_nsec, &dm.m.has_query_time_nsec);
|
|
|
|
|
|
|
|
|
|
/* query_message */
|
|
|
|
|
dt_fill_buffer(qmsg, &dm.m.query_message, &dm.m.has_query_message);
|
|
|
|
|
|
2020-12-09 05:00:51 -05:00
|
|
|
/* socket_family, socket_protocol, query_address, query_port, response_address, response_port */
|
2023-12-26 17:26:21 -05:00
|
|
|
dt_msg_fill_net(&dm, qsock, rsock, cptype, cpssl,
|
2014-08-05 03:57:52 -04:00
|
|
|
&dm.m.query_address, &dm.m.has_query_address,
|
2020-12-09 05:00:51 -05:00
|
|
|
&dm.m.query_port, &dm.m.has_query_port,
|
|
|
|
|
&dm.m.response_address, &dm.m.has_response_address,
|
|
|
|
|
&dm.m.response_port, &dm.m.has_response_port);
|
|
|
|
|
|
2014-08-05 03:57:52 -04:00
|
|
|
|
|
|
|
|
if (dt_pack(&dm.d, &dm.buf, &dm.len_buf))
|
|
|
|
|
dt_send(env, dm.buf, dm.len_buf);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
dt_msg_send_client_response(struct dt_env *env,
|
|
|
|
|
struct sockaddr_storage *qsock,
|
2020-12-09 05:00:51 -05:00
|
|
|
struct sockaddr_storage *rsock,
|
2014-08-05 03:57:52 -04:00
|
|
|
enum comm_point_type cptype,
|
2023-12-26 17:26:21 -05:00
|
|
|
void *cpssl,
|
2014-08-05 03:57:52 -04:00
|
|
|
sldns_buffer *rmsg)
|
|
|
|
|
{
|
|
|
|
|
struct dt_msg dm;
|
|
|
|
|
struct timeval rtime;
|
|
|
|
|
|
2024-07-19 04:04:40 -04:00
|
|
|
if(dt_sample_rate_limited(env))
|
|
|
|
|
return;
|
|
|
|
|
|
2014-08-05 03:57:52 -04:00
|
|
|
gettimeofday(&rtime, NULL);
|
|
|
|
|
|
|
|
|
|
/* type */
|
|
|
|
|
dt_msg_init(env, &dm, DNSTAP__MESSAGE__TYPE__CLIENT_RESPONSE);
|
|
|
|
|
|
|
|
|
|
/* response_time */
|
|
|
|
|
dt_fill_timeval(&rtime,
|
|
|
|
|
&dm.m.response_time_sec, &dm.m.has_response_time_sec,
|
|
|
|
|
&dm.m.response_time_nsec, &dm.m.has_response_time_nsec);
|
|
|
|
|
|
|
|
|
|
/* response_message */
|
|
|
|
|
dt_fill_buffer(rmsg, &dm.m.response_message, &dm.m.has_response_message);
|
|
|
|
|
|
2020-12-09 05:00:51 -05:00
|
|
|
/* socket_family, socket_protocol, query_address, query_port, response_address, response_port */
|
2023-12-26 17:26:21 -05:00
|
|
|
dt_msg_fill_net(&dm, qsock, rsock, cptype, cpssl,
|
2014-08-05 03:57:52 -04:00
|
|
|
&dm.m.query_address, &dm.m.has_query_address,
|
2020-12-09 05:00:51 -05:00
|
|
|
&dm.m.query_port, &dm.m.has_query_port,
|
|
|
|
|
&dm.m.response_address, &dm.m.has_response_address,
|
|
|
|
|
&dm.m.response_port, &dm.m.has_response_port);
|
2014-08-05 03:57:52 -04:00
|
|
|
|
|
|
|
|
if (dt_pack(&dm.d, &dm.buf, &dm.len_buf))
|
|
|
|
|
dt_send(env, dm.buf, dm.len_buf);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
dt_msg_send_outside_query(struct dt_env *env,
|
|
|
|
|
struct sockaddr_storage *rsock,
|
2020-12-09 05:00:51 -05:00
|
|
|
struct sockaddr_storage *qsock,
|
2014-08-05 03:57:52 -04:00
|
|
|
enum comm_point_type cptype,
|
2023-12-26 17:26:21 -05:00
|
|
|
void *cpssl,
|
2014-08-05 03:57:52 -04:00
|
|
|
uint8_t *zone, size_t zone_len,
|
|
|
|
|
sldns_buffer *qmsg)
|
|
|
|
|
{
|
|
|
|
|
struct dt_msg dm;
|
|
|
|
|
struct timeval qtime;
|
|
|
|
|
uint16_t qflags;
|
|
|
|
|
|
2024-07-19 04:04:40 -04:00
|
|
|
if(dt_sample_rate_limited(env))
|
|
|
|
|
return;
|
|
|
|
|
|
2014-08-05 03:57:52 -04:00
|
|
|
gettimeofday(&qtime, NULL);
|
|
|
|
|
qflags = sldns_buffer_read_u16_at(qmsg, 2);
|
|
|
|
|
|
|
|
|
|
/* type */
|
2025-06-11 10:42:43 -04:00
|
|
|
if ((qflags & BIT_RD)) {
|
2014-08-05 03:57:52 -04:00
|
|
|
if (!env->log_forwarder_query_messages)
|
|
|
|
|
return;
|
|
|
|
|
dt_msg_init(env, &dm, DNSTAP__MESSAGE__TYPE__FORWARDER_QUERY);
|
|
|
|
|
} else {
|
|
|
|
|
if (!env->log_resolver_query_messages)
|
|
|
|
|
return;
|
|
|
|
|
dt_msg_init(env, &dm, DNSTAP__MESSAGE__TYPE__RESOLVER_QUERY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* query_zone */
|
|
|
|
|
dm.m.query_zone.data = zone;
|
|
|
|
|
dm.m.query_zone.len = zone_len;
|
|
|
|
|
dm.m.has_query_zone = 1;
|
|
|
|
|
|
|
|
|
|
/* query_time_sec, query_time_nsec */
|
|
|
|
|
dt_fill_timeval(&qtime,
|
|
|
|
|
&dm.m.query_time_sec, &dm.m.has_query_time_sec,
|
|
|
|
|
&dm.m.query_time_nsec, &dm.m.has_query_time_nsec);
|
|
|
|
|
|
|
|
|
|
/* query_message */
|
|
|
|
|
dt_fill_buffer(qmsg, &dm.m.query_message, &dm.m.has_query_message);
|
|
|
|
|
|
2020-12-09 05:00:51 -05:00
|
|
|
/* socket_family, socket_protocol, response_address, response_port, query_address, query_port */
|
2023-12-26 17:26:21 -05:00
|
|
|
dt_msg_fill_net(&dm, rsock, qsock, cptype, cpssl,
|
2014-08-05 03:57:52 -04:00
|
|
|
&dm.m.response_address, &dm.m.has_response_address,
|
2020-12-09 05:00:51 -05:00
|
|
|
&dm.m.response_port, &dm.m.has_response_port,
|
|
|
|
|
&dm.m.query_address, &dm.m.has_query_address,
|
|
|
|
|
&dm.m.query_port, &dm.m.has_query_port);
|
2014-08-05 03:57:52 -04:00
|
|
|
|
|
|
|
|
if (dt_pack(&dm.d, &dm.buf, &dm.len_buf))
|
|
|
|
|
dt_send(env, dm.buf, dm.len_buf);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
dt_msg_send_outside_response(struct dt_env *env,
|
2021-06-08 16:15:17 -04:00
|
|
|
struct sockaddr_storage *rsock,
|
|
|
|
|
struct sockaddr_storage *qsock,
|
|
|
|
|
enum comm_point_type cptype,
|
2023-12-26 17:26:21 -05:00
|
|
|
void *cpssl,
|
2021-06-08 16:15:17 -04:00
|
|
|
uint8_t *zone, size_t zone_len,
|
|
|
|
|
uint8_t *qbuf, size_t qbuf_len,
|
|
|
|
|
const struct timeval *qtime,
|
|
|
|
|
const struct timeval *rtime,
|
|
|
|
|
sldns_buffer *rmsg)
|
2014-08-05 03:57:52 -04:00
|
|
|
{
|
|
|
|
|
struct dt_msg dm;
|
|
|
|
|
uint16_t qflags;
|
|
|
|
|
|
2024-07-19 04:04:40 -04:00
|
|
|
if(dt_sample_rate_limited(env))
|
|
|
|
|
return;
|
|
|
|
|
|
2021-06-08 16:15:17 -04:00
|
|
|
(void)qbuf_len; log_assert(qbuf_len >= sizeof(qflags));
|
2014-08-05 03:57:52 -04:00
|
|
|
memcpy(&qflags, qbuf, sizeof(qflags));
|
|
|
|
|
qflags = ntohs(qflags);
|
|
|
|
|
|
|
|
|
|
/* type */
|
2025-06-11 10:42:43 -04:00
|
|
|
if ((qflags & BIT_RD)) {
|
2014-08-05 03:57:52 -04:00
|
|
|
if (!env->log_forwarder_response_messages)
|
|
|
|
|
return;
|
|
|
|
|
dt_msg_init(env, &dm, DNSTAP__MESSAGE__TYPE__FORWARDER_RESPONSE);
|
|
|
|
|
} else {
|
2016-03-21 05:04:21 -04:00
|
|
|
if (!env->log_resolver_response_messages)
|
2014-08-05 03:57:52 -04:00
|
|
|
return;
|
|
|
|
|
dt_msg_init(env, &dm, DNSTAP__MESSAGE__TYPE__RESOLVER_RESPONSE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* query_zone */
|
|
|
|
|
dm.m.query_zone.data = zone;
|
|
|
|
|
dm.m.query_zone.len = zone_len;
|
|
|
|
|
dm.m.has_query_zone = 1;
|
|
|
|
|
|
|
|
|
|
/* query_time_sec, query_time_nsec */
|
|
|
|
|
dt_fill_timeval(qtime,
|
|
|
|
|
&dm.m.query_time_sec, &dm.m.has_query_time_sec,
|
|
|
|
|
&dm.m.query_time_nsec, &dm.m.has_query_time_nsec);
|
|
|
|
|
|
|
|
|
|
/* response_time_sec, response_time_nsec */
|
|
|
|
|
dt_fill_timeval(rtime,
|
|
|
|
|
&dm.m.response_time_sec, &dm.m.has_response_time_sec,
|
|
|
|
|
&dm.m.response_time_nsec, &dm.m.has_response_time_nsec);
|
|
|
|
|
|
|
|
|
|
/* response_message */
|
|
|
|
|
dt_fill_buffer(rmsg, &dm.m.response_message, &dm.m.has_response_message);
|
|
|
|
|
|
2020-12-09 05:00:51 -05:00
|
|
|
/* socket_family, socket_protocol, response_address, response_port, query_address, query_port */
|
2023-12-26 17:26:21 -05:00
|
|
|
dt_msg_fill_net(&dm, rsock, qsock, cptype, cpssl,
|
2014-08-05 03:57:52 -04:00
|
|
|
&dm.m.response_address, &dm.m.has_response_address,
|
2020-12-09 05:00:51 -05:00
|
|
|
&dm.m.response_port, &dm.m.has_response_port,
|
|
|
|
|
&dm.m.query_address, &dm.m.has_query_address,
|
|
|
|
|
&dm.m.query_port, &dm.m.has_query_port);
|
2014-08-05 03:57:52 -04:00
|
|
|
|
|
|
|
|
if (dt_pack(&dm.d, &dm.buf, &dm.len_buf))
|
|
|
|
|
dt_send(env, dm.buf, dm.len_buf);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* USE_DNSTAP */
|