client.c revision f3c8e48b95996c3020d138b87ee8941da29cc124
7d32c065c7bb56f281651ae3dd2888f32ce4f1d9Bob Halley * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
2f072c2982861ec2e86e97f8a3ed199fe45c1f70Michael Graff * Copyright (C) 1999-2003 Internet Software Consortium.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * Permission to use, copy, modify, and/or distribute this software for any
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * purpose with or without fee is hereby granted, provided that the above
2f072c2982861ec2e86e97f8a3ed199fe45c1f70Michael Graff * copyright notice and this permission notice appear in all copies.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * PERFORMANCE OF THIS SOFTWARE.
419590499823ce15b5d2ad4fe71eaf04bd5a86c0Michael Graff/* $Id: client.c,v 1.286 2012/01/31 23:47:30 tbox Exp $ */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * Client Routines
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * Important note!
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * All client state changes, other than that from idle to listening, occur
ea8651059209b96fa005e06a0b9b33ae5a8eacd4David Lawrence * as a result of events. This guarantees serialization and avoids the
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * need for locking.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * If a routine is ever created that allows someone other than the client's
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * task to change the client, then the client will have to be locked.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson#define MTRACE(m) isc_log_write(ns_g_lctx, \
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews#define CTRACE(m) ((void)(m))
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews#define MTRACE(m) ((void)(m))
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews#define TCP_CLIENT(c) (((c)->attributes & NS_CLIENTATTR_TCP) != 0)
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff * Number of 'mctx pools' for clients. (Should this be configurable?)
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * When enabling threads, we use a pool of memory contexts shared by
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * client objects, since concurrent access to a shared context would cause
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * heavy contentions. The above constant is expected to be enough for
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * completely avoiding contentions among threads for an authoritative-only
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * If named with built without thread, simply share manager's context. Using
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * a separate context in this case would simply waste memory.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews/*% nameserver client manager structure */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews /* Unlocked. */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews unsigned int magic;
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews /* The queue object has its own locks */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews client_queue_t inactive; /*%< To be recycled */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews /* Lock covers manager state. */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews /* Lock covers the clients list */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews client_list_t clients; /*%< All active clients */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews /* Lock covers the recursing list */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews client_list_t recursing; /*%< Recursing clients */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews /*%< mctx pool for clients. */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews unsigned int nextmctx;
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews#define MANAGER_MAGIC ISC_MAGIC('N', 'S', 'C', 'm')
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson#define VALID_MANAGER(m) ISC_MAGIC_VALID(m, MANAGER_MAGIC)
fad44a20eede1bbc66716241dede225500c91caaAndreas Gustafsson * Client object states. Ordering is significant: higher-numbered
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * states are generally "more active", meaning that the client can
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * have more dynamically allocated data, outstanding events, etc.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * In the list below, any such properties listed for state N
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * also apply to any state > N.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * To force the client into a less active state, set client->newstate
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * to that state and call exit_check(). This will cause any
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * activities defined for higher-numbered states to be aborted.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * The client object no longer exists.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * The client object exists and has a task and timer.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * Its "query" struct and sendbuf are initialized.
2bc0da0cd874b15593d65338ba96e90ceed13072Mark Andrews * It is on the client manager's list of inactive clients.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * It has a message and OPT, both in the reset state.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * The client object is either a TCP or a UDP one, and
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * it is associated with a network interface. It is on the
fad44a20eede1bbc66716241dede225500c91caaAndreas Gustafsson * client manager's list of active clients.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * If it is a TCP client object, it has a TCP listener socket
419590499823ce15b5d2ad4fe71eaf04bd5a86c0Michael Graff * and an outstanding TCP listen request.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * If it is a UDP client object, it has a UDP listener socket
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff * and an outstanding UDP receive request.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * The client object is a TCP client object that has received
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * a connection. It has a tcpsocket, tcpmsg, TCP quota, and an
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * outstanding TCP read request. This state is not used for
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * UDP client objects.
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews * The client object has received a request and is working
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * on it. It has a view, and it may have any of a non-reset OPT,
542deb20c44666a870855bf755a100d254db074dAndreas Gustafsson * recursion quota, and an outstanding write request.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * The client object is recursing. It will be on the 'recursing'
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * Sentinel value used to indicate "no state". When client->newstate
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * has this value, we are not attempting to exit the current state.
419590499823ce15b5d2ad4fe71eaf04bd5a86c0Michael Graff * Must be greater than any valid state.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * Enable ns_client_dropport() by default.
542deb20c44666a870855bf755a100d254db074dAndreas Gustafssonstatic void client_read(ns_client_t *client);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrewsstatic void client_udprecv(ns_client_t *client);
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graffstatic void clientmgr_destroy(ns_clientmgr_t *manager);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrewsstatic isc_boolean_t exit_check(ns_client_t *client);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrewsstatic void ns_client_endrequest(ns_client_t *client);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrewsstatic void client_start(isc_task_t *task, isc_event_t *event);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrewsstatic void client_request(isc_task_t *task, isc_event_t *event);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrewsstatic void ns_client_dumpmessage(ns_client_t *client, const char *reason);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrewsstatic isc_result_t get_client(ns_clientmgr_t *manager, ns_interface_t *ifp,
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews REQUIRE(client->state == NS_CLIENTSTATE_WORKING);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews client->newstate = client->state = NS_CLIENTSTATE_RECURSING;
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews ISC_LIST_APPEND(client->manager->recursing, client, rlink);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrewsns_client_killoldestquery(ns_client_t *client) {
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews oldest = ISC_LIST_HEAD(client->manager->recursing);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews ISC_LIST_UNLINK(client->manager->recursing, oldest, rlink);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrewsns_client_settimeout(ns_client_t *client, unsigned int seconds) {
e6c22f37d8df55a9f66b479a22717e179bcf79a3Andreas Gustafsson result = isc_timer_reset(client->timer, isc_timertype_once, NULL,
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews "setting timeout: %s",
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews /* Continue anyway. */
e6c22f37d8df55a9f66b479a22717e179bcf79a3Andreas Gustafsson * Check for a deactivation or shutdown request and take appropriate
e6c22f37d8df55a9f66b479a22717e179bcf79a3Andreas Gustafsson * action. Returns ISC_TRUE if either is in progress; in this case
e6c22f37d8df55a9f66b479a22717e179bcf79a3Andreas Gustafsson * the caller must no longer use the client object as it may have been
e6c22f37d8df55a9f66b479a22717e179bcf79a3Andreas Gustafsson return (ISC_FALSE); /* Business as usual. */
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews INSIST(client->newstate < NS_CLIENTSTATE_RECURSING);
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * We need to detach from the view early when shutting down
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews * the server to break the following vicious circle:
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff * - The resolver will not shut down until the view refcount is zero
d981ca645597116d227a48bf37cc5edc061c854dBob Halley * - The view refcount does not go to zero until all clients detach
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews * - The client does not detach from the view until references is zero
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews * - references does not go to zero until the resolver has shut down
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * Keep the view attached until any outstanding updates complete.
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews client->newstate == NS_CLIENTSTATE_FREED && client->view != NULL)
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington INSIST(client->newstate <= NS_CLIENTSTATE_READING);
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * Let the update processing complete.
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * We are trying to abort request processing.
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington if (! (client->nsends == 0 && client->nrecvs == 0 &&
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * Still waiting for I/O cancel completion.
cf3f14106d082e4676431c10c54b60b9a0e9b127Brian Wellington * or lingering references.
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * I/O cancel is complete. Burn down all state
419590499823ce15b5d2ad4fe71eaf04bd5a86c0Michael Graff * related to the current request. Ensure that
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * the client is no longer on the recursing list.
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * We need to check whether the client is still linked,
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * because it may already have been removed from the
419590499823ce15b5d2ad4fe71eaf04bd5a86c0Michael Graff * recursing list by ns_client_killoldestquery()
ffe74cc719aa0f10c38fbc1f2f3ea7db0960cb8fMark Andrews if (client->state == NS_CLIENTSTATE_RECURSING) {
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington if (NS_CLIENTSTATE_READING == client->newstate) {
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington if (client->state == NS_CLIENTSTATE_READING) {
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * We are trying to abort the current TCP connection,
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington INSIST(client->newstate <= NS_CLIENTSTATE_READY);
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington /* Still waiting for read cancel completion. */
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * Now the client is ready to accept a new TCP connection
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * or UDP request, but we may have enough clients doing
cf3f14106d082e4676431c10c54b60b9a0e9b127Brian Wellington * that already. Check whether this client needs to remain
cf3f14106d082e4676431c10c54b60b9a0e9b127Brian Wellington * active and force it to go inactive if not.
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * UDP clients go inactive at this point, but TCP clients
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * may remain active if we have fewer active TCP client
b5da378f2987a115491c291d062252f3152d8db8Brian Wellington * objects than desired due to an earlier quota exhaustion.
542deb20c44666a870855bf755a100d254db074dAndreas Gustafsson if (client->mortal && TCP_CLIENT(client) && !ns_g_clienttest) {
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrews * We don't need the client; send it to the inactive
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington * queue for recycling.
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington if (client->newstate > NS_CLIENTSTATE_INACTIVE)
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington client->newstate = NS_CLIENTSTATE_INACTIVE;
d8813e2ceee2f4adaf697931c2491de265ce5eb9Brian Wellington if (NS_CLIENTSTATE_READY == client->newstate) {
542deb20c44666a870855bf755a100d254db074dAndreas Gustafsson if (client->state == NS_CLIENTSTATE_READY) {
d981ca645597116d227a48bf37cc5edc061c854dBob Halley INSIST(client->newstate <= NS_CLIENTSTATE_INACTIVE);
d981ca645597116d227a48bf37cc5edc061c854dBob Halley * We are trying to enter the inactive state.
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley isc_socket_cancel(client->tcplistener, client->task,
542deb20c44666a870855bf755a100d254db074dAndreas Gustafsson /* Still waiting for accept cancel completion. */
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley /* Accept cancel is complete. */
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley isc_socket_cancel(client->udpsocket, client->task,
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley /* Still waiting for recv cancel completion. */
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley /* Still waiting for control event to be delivered */
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley /* Deactivate the client. */
ilink);
return (ISC_TRUE);
INSIST(0);
return (ISC_TRUE);
int newstate;
static isc_result_t
unsigned char *data;
goto done;
goto done;
goto done;
done:
return (result);
static isc_result_t
isc_region_t r;
int match;
match > 0)
return (DNS_R_BLACKHOLED);
return (result);
unsigned char *data;
isc_region_t r;
goto done;
goto done;
goto done;
done:
unsigned char *data;
isc_region_t r;
unsigned int render_opts;
unsigned int preferred_glue;
render_opts = 0;
preferred_glue = 0;
#ifdef ALLOW_FILTER_AAAA
goto done;
goto done;
goto done;
goto done;
DNS_SECTION_QUESTION, 0);
goto renderend;
goto done;
goto renderend;
goto renderend;
goto done;
goto renderend;
goto done;
goto done;
goto done;
if (cleanup_cctx) {
if (opt_included) {
done:
if (cleanup_cctx)
if (ns_g_delay != 0) {
goto nodelay;
#define DROPPORT_NO 0
switch (port) {
return (DROPPORT_REQUEST);
return (DROPPORT_RESPONSE);
return (DROPPORT_NO);
DROPPORT_NO) {
isc_buffer_t b;
if (wouldlog) {
static inline isc_result_t
return (result);
return (result);
return (result);
goto no_nsid;
goto no_nsid;
== ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
static inline isc_boolean_t
int match;
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
if (!match)
int match;
unsigned int flags;
goto cleanup;
goto cleanup;
goto cleanup;
match > 0)
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
case dns_opcode_query:
case dns_opcode_update:
case dns_opcode_notify:
case dns_opcode_iquery:
if (ns_g_noedns)
if (ns_g_dropedns) {
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
&sockaddr);
goto cleanup;
view);
isc_buffer_t b;
isc_region_t *r;
sizeof(classname));
goto cleanup;
isc_buffer_t b;
goto cleanup;
case dns_opcode_query:
case dns_opcode_update:
case dns_opcode_notify:
case dns_opcode_iquery:
static isc_result_t
#if NMCTXS > 0
unsigned int nextmctx;
if (ns_g_clienttest) {
return (result);
#if NMCTXS > 0
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
return (result);
return (ISC_R_NOMEMORY);
goto cleanup_client;
goto cleanup_task;
goto cleanup_timer;
goto cleanup_message;
goto cleanup_sendevent;
goto cleanup_recvbuf;
#ifdef ALLOW_FILTER_AAAA
goto cleanup_recvevent;
goto cleanup_query;
return (ISC_R_SUCCESS);
return (result);
goto fail;
fail:
goto freeevent;
int match;
match > 0)
goto freeevent;
isc_region_t r;
return (result);
return (ISC_R_SUCCESS);
#if NMCTXS > 0
#if NMCTXS > 0
for (i = 0; i < NMCTXS; i++) {
#if NMCTXS > 0
return (ISC_R_NOMEMORY);
goto cleanup_manager;
goto cleanup_lock;
goto cleanup_listlock;
#if NMCTXS > 0
for (i = 0; i < NMCTXS; i++)
return (ISC_R_SUCCESS);
return (result);
if (unlock)
if (need_destroy)
static isc_result_t
return (ISC_R_SHUTTINGDOWN);
if (!ns_g_clienttest)
return (result);
if (tcp) {
return (ISC_R_SUCCESS);
unsigned int disp;
REQUIRE(n > 0);
return (result);
int match;
if (default_allow)
goto allow;
goto deny;
if (match > 0)
goto allow;
return (ISC_R_SUCCESS);
deny:
return (DNS_R_REFUSED);
return (result);
if (q != NULL) {
classbuf);
0, &buffer);
buf);
const char *name;
const char *sep;
const char *origfor;
sizeof(original));
sizeof(typebuf));
sizeof(classbuf));
return (ISC_R_SUCCESS);