dnssec-secure-to-insecure <boolean>;
dnssec-update-mode ( maintain | no-resign );
dnssec-validation ( yes | no | auto );
- dnstap { ( all | auth | client | forwarder | resolver | update ) [
- ( query | response ) ]; ... };
- dnstap-identity ( <quoted_string> | none | hostname );
- dnstap-output ( file | unix ) <quoted_string> [ size ( unlimited |
- <size> ) ] [ versions ( unlimited | <integer> ) ] [ suffix (
- increment | timestamp ) ];
- dnstap-version ( <quoted_string> | none );
+ dnstap { ( all | auth | client | forwarder |
+ resolver | update ) [ ( query | response ) ];
+ ... }; // not configured
+ dnstap-identity ( <quoted_string> | none |
+ hostname ); // not configured
+ dnstap-output ( file | unix ) <quoted_string> [
+ size ( unlimited | <size> ) ] [ versions (
+ unlimited | <integer> ) ] [ suffix ( increment
+ | timestamp ) ]; // not configured
+ dnstap-version ( <quoted_string> | none ); // not configured
dscp <integer>;
dual-stack-servers [ port <integer> ] { ( <quoted_string> [ port
<integer> ] [ dscp <integer> ] | <ipv4_address> [ port
forward ( first | only );
forwarders [ port <integer> ] [ dscp <integer> ] { ( <ipv4_address>
| <ipv6_address> ) [ port <integer> ] [ dscp <integer> ]; ... };
- fstrm-set-buffer-hint <integer>;
- fstrm-set-flush-timeout <integer>;
- fstrm-set-input-queue-size <integer>;
- fstrm-set-output-notify-threshold <integer>;
- fstrm-set-output-queue-model ( mpsc | spsc );
- fstrm-set-output-queue-size <integer>;
- fstrm-set-reopen-interval <duration>;
+ fstrm-set-buffer-hint <integer>; // not configured
+ fstrm-set-flush-timeout <integer>; // not configured
+ fstrm-set-input-queue-size <integer>; // not configured
+ fstrm-set-output-notify-threshold <integer>; // not configured
+ fstrm-set-output-queue-model ( mpsc | spsc ); // not configured
+ fstrm-set-output-queue-size <integer>; // not configured
+ fstrm-set-reopen-interval <duration>; // not configured
geoip-directory ( <quoted_string> | none );
geoip-use-ecs <boolean>; // obsolete
glue-cache <boolean>;
dnssec-secure-to-insecure <boolean>;
dnssec-update-mode ( maintain | no-resign );
dnssec-validation ( yes | no | auto );
- dnstap { ( all | auth | client | forwarder | resolver | update ) [
- ( query | response ) ]; ... };
+ dnstap { ( all | auth | client | forwarder |
+ resolver | update ) [ ( query | response ) ];
+ ... }; // not configured
dual-stack-servers [ port <integer> ] { ( <quoted_string> [ port
<integer> ] [ dscp <integer> ] | <ipv4_address> [ port
<integer> ] [ dscp <integer> ] | <ipv6_address> [ port
/*%<
* Decrement socket-related statistics counters.
*/
+
+const char *
+isc__nm_socket_type(isc_nmsocket_type type);
+/*%<
+ * Returns socket type as a string for logging purposes.
+ */
static void
process_queue(isc__networker_t *worker, isc_queue_t *queue);
+const char *
+isc__nm_socket_type(isc_nmsocket_type type) {
+ switch(type) {
+ case isc_nm_udpsocket:
+ return("udpsocket");
+ case isc_nm_udplistener:
+ return("udplistener");
+ case isc_nm_tcpsocket:
+ return("tcpsocket");
+ case isc_nm_tcplistener:
+ return("tcplistener");
+ case isc_nm_tcpdnssocket:
+ return("tcpdnssocket");
+ case isc_nm_tcpdnslistener:
+ return("tcpdnslistener");
+ default:
+ INSIST(0);
+ ISC_UNREACHABLE();
+ }
+}
+
int
isc_nm_tid(void) {
return (isc__nm_tid_v);
if (sock->parent != NULL) {
INSIST(sock->parent->parent == NULL); /* sanity check */
+fprintf(stderr, "attach sock %p (%s) (%p) to %lu\n", sock, isc__nm_socket_type(sock->type), sock->parent, sock->parent->references+1);
isc_refcount_increment0(&sock->parent->references);
} else {
+fprintf(stderr, "attach sock %p (%s) to %lu\n", sock, isc__nm_socket_type(sock->type), sock->references+1);
isc_refcount_increment0(&sock->references);
}
if (sock->outerhandle != NULL) {
isc_nmhandle_unref(sock->outerhandle);
+fprintf(stderr, "sock %p outerhandle %p, clearing?\n", sock, sock->outerhandle);
sock->outerhandle = NULL;
}
*/
if (sock->parent != NULL) {
rsock = sock->parent;
+fprintf(stderr, "detach sock %p (%s) (%p) to %lu\n", sock, isc__nm_socket_type(sock->type), rsock, rsock->references-1);
INSIST(rsock->parent == NULL); /* Sanity check */
} else {
+fprintf(stderr, "detach sock %p (%s) to %lu\n", sock, isc__nm_socket_type(sock->type), sock->references-1);
rsock = sock;
}
REQUIRE(iface != NULL);
family = iface->addr.type.sa.sa_family;
+fprintf(stderr, "init sock %p (%s)\n", sock, isc__nm_socket_type(type));
*sock = (isc_nmsocket_t){ .type = type,
.iface = iface,
isc_nmhandle_ref(isc_nmhandle_t *handle) {
REQUIRE(VALID_NMHANDLE(handle));
+fprintf(stderr, "ref %p (%p %s) to %lu\n", handle, handle->sock, isc__nm_socket_type(handle->sock->type), handle->references+1);
isc_refcount_increment(&handle->references);
}
REQUIRE(VALID_NMHANDLE(handle));
+fprintf(stderr, "unref %p (%p %s) to %lu\n", handle, handle->sock, isc__nm_socket_type(handle->sock->type), handle->references-1);
if (isc_refcount_decrement(&handle->references) > 1) {
return;
}
/* We need an acquire memory barrier here */
(void)isc_refcount_current(&handle->references);
+ /*
+ * XXX: Do we need to reference the socket to ensure that it
+ * can't be deleted by another thread while we're deactivating
+ * the handle?
+ */
sock = handle->sock;
handle->sock = NULL;
+fprintf(stderr, "handle %p sock %p set to NULL\n", handle, sock);
if (handle->doreset != NULL) {
handle->doreset(handle->opaque);
}
- /*
- * Temporarily reference the socket to ensure that it can't
- * be deleted by another thread while we're deactivating the
- * handle.
- */
nmhandle_deactivate(sock, handle);
/*
timer_close_cb(uv_handle_t *handle) {
isc_nmsocket_t *sock = (isc_nmsocket_t *)uv_handle_get_data(handle);
INSIST(VALID_NMSOCK(sock));
+fprintf(stderr, "timer close cb, sock %p\n", sock);
}
static void
isc_nmsocket_t *dnslistensock = (isc_nmsocket_t *)cbarg;
isc_nmsocket_t *dnssock = NULL;
+fprintf(stderr, "dnslisten_acceptcb %p %s\n", handle, isc_result_totext(result));
REQUIRE(VALID_NMSOCK(dnslistensock));
REQUIRE(dnslistensock->type == isc_nm_tcpdnslistener);
REQUIRE(VALID_NMHANDLE(handle));
REQUIRE(dnssock->tid == isc_nm_tid());
+fprintf(stderr, "dnslisten_readcb %p (reg %p), sock %p (%s)\n", handle, handle->sock, region, handle->sock ? isc__nm_socket_type(handle->sock->type) : "nil");
if (region == NULL) {
/* Connection closed */
isc__nm_tcpdns_close(dnssock);
isc_nmhandle_t *dnshandle = NULL;
result = processbuffer(dnssock, &dnshandle);
+fprintf(stderr, "processbuffer sock %p with handle %p, result %s\n", dnssock, dnshandle, isc_result_totext(result));
if (result != ISC_R_SUCCESS) {
/*
* There wasn't anything in the buffer to process.
isc_nmhandle_t *handle = NULL;
result = processbuffer(sock, &handle);
+fprintf(stderr, "processed sequential sock %p with handle %p, result %s\n", sock, handle, isc_result_totext(result));
if (result == ISC_R_SUCCESS) {
atomic_store(&sock->outerhandle->sock->processing,
true);
isc_nmhandle_t *dnshandle = NULL;
result = processbuffer(sock, &dnshandle);
+fprintf(stderr, "processed nonsequentially sock %p with handle %p, result %s\n", sock, dnshandle, isc_result_totext(result));
if (result != ISC_R_SUCCESS) {
/*
* Nothing in the buffer; resume reading.
atomic_store(&sock->outerhandle->sock->processing, true);
isc_nmhandle_unref(dnshandle);
} while (atomic_load(&sock->ah) < TCPDNS_CLIENTS_PER_CONN);
+
+
}
static void
tcpdnssend_cb(isc_nmhandle_t *handle, isc_result_t result, void *cbarg) {
tcpsend_t *ts = (tcpsend_t *)cbarg;
+fprintf(stderr, "tcpdnssend_cb %p %s\n", handle, isc_result_totext(result));
ts->cb(ts->orighandle, result, ts->cbarg);
isc_mem_put(ts->mctx, ts->region.base, ts->region.length);
static void
tcpdns_close_direct(isc_nmsocket_t *sock) {
REQUIRE(sock->tid == isc_nm_tid());
+
+fprintf(stderr, "close sock %p (tcpdns)\n", sock);
/* We don't need atomics here, it's all in single network thread */
if (sock->timer_initialized) {
/*
*/
sock->timer_initialized = false;
uv_timer_stop(&sock->timer);
+fprintf(stderr, "closing timer\n");
uv_close((uv_handle_t *)&sock->timer, timer_close_cb);
+fprintf(stderr, "...done\n");
} else {
/*
* At this point we're certain that there are no external
* references, we can close everything.
*/
if (sock->outerhandle != NULL) {
+fprintf(stderr, "clearing outerhandle\n");
sock->outerhandle->sock->rcb.recv = NULL;
isc_nmhandle_unref(sock->outerhandle);
sock->outerhandle = NULL;
}
if (sock->listener != NULL) {
+fprintf(stderr, "clearing listener\n");
isc__nmsocket_detach(&sock->listener);
}
atomic_store(&sock->closed, true);
+fprintf(stderr, "prep socket destruction\n");
isc__nmsocket_prep_destroy(sock);
}
+fprintf(stderr, "closed\n");
}
void