client.c revision 0618287859d99c2fc69790df28500fb37324d43d
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Copyright (C) 2009-2013 Internet Systems Consortium, Inc. ("ISC")
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Permission to use, copy, modify, and/or distribute this software for any
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * purpose with or without fee is hereby granted, provided that the above
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
15a44745412679c30a6d022733925af70a38b715David Lawrence * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15a44745412679c30a6d022733925af70a38b715David Lawrence * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15a44745412679c30a6d022733925af70a38b715David Lawrence * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15a44745412679c30a6d022733925af70a38b715David Lawrence * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15a44745412679c30a6d022733925af70a38b715David Lawrence * PERFORMANCE OF THIS SOFTWARE.
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer/* $Id: client.c,v 1.14 2011/03/12 04:59:47 tbox Exp $ */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define DNS_CLIENT_MAGIC ISC_MAGIC('D', 'N', 'S', 'c')
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define DNS_CLIENT_VALID(c) ISC_MAGIC_VALID(c, DNS_CLIENT_MAGIC)
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define RCTX_MAGIC ISC_MAGIC('R', 'c', 't', 'x')
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define RCTX_VALID(c) ISC_MAGIC_VALID(c, RCTX_MAGIC)
1893b56ef9f5f2bc2a0fbe80d3c6b69df1bdc7c2Michael Sawyer#define REQCTX_MAGIC ISC_MAGIC('R', 'q', 'c', 'x')
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington#define REQCTX_VALID(c) ISC_MAGIC_VALID(c, REQCTX_MAGIC)
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define UCTX_MAGIC ISC_MAGIC('U', 'c', 't', 'x')
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer#define UCTX_VALID(c) ISC_MAGIC_VALID(c, UCTX_MAGIC)
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * DNS client object
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer /* Unlocked */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer unsigned int magic;
a5ed46c9fd270775c39770bfd0250a52d374ebf2Michael Sawyer * Timeout/retry constants for dynamic update borrowed from nsupdate
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Internal state for a single name resolution procedure
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyertypedef struct resctx {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer /* Unlocked */
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer unsigned int magic;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Argument of an internal event for synchronous name resolution.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyertypedef struct resarg {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer /* Unlocked */
cc48bb397fa6ba889f25157840492e68114dec8fBrian Wellington * Internal state for a single DNS request
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellingtontypedef struct reqctx {
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington /* Unlocked */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Argument of an internal event for synchronous DNS request.
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafssontypedef struct reqarg {
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson /* Unlocked */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Argument of an internal event for synchronous name resolution.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyertypedef struct updatearg {
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson /* Unlocked */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Internal state for a single dynamic update procedure
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrencetypedef struct updatectx {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer /* Unlocked */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer unsigned int magic;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer /* Task Locked */
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic isc_result_t request_soa(updatectx_t *uctx);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void client_resfind(resctx_t *rctx, dns_fetchevent_t *event);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic isc_result_t send_update(updatectx_t *uctx);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyergetudpdispatch(int family, dns_dispatchmgr_t *dispatchmgr,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer isc_socketmgr_t *socketmgr, isc_taskmgr_t *taskmgr,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer isc_boolean_t is_shared, dns_dispatch_t **dispp,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer unsigned buffersize, maxbuffers, maxrequests, buckets, increment;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = dns_dispatch_getudp(dispatchmgr, socketmgr,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerdns_client_createview(isc_mem_t *mctx, dns_rdataclass_t rdclass,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer unsigned int options, isc_taskmgr_t *taskmgr,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer unsigned int ntasks, isc_socketmgr_t *socketmgr,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer isc_timermgr_t *timermgr, dns_dispatchmgr_t *dispatchmgr,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer dns_dispatch_t *dispatchv4, dns_dispatch_t *dispatchv6,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = dns_view_create(mctx, rdclass, DNS_CLIENTVIEW_NAME, &view);
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence /* Initialize view security roots */
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence result = dns_view_createresolver(view, taskmgr, ntasks, 1, socketmgr,
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Set cache DB.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * XXX: it may be better if specific DB implementations can be
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * specified via some configuration knob.
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer if ((options & DNS_CLIENTCREATEOPT_USECACHE) != 0)
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = dns_db_create(mctx, dbtype, dns_rootname, dns_dbtype_cache,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyerdns_client_create(dns_client_t **clientp, unsigned int options) {
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer /* XXXMPA add debug logging support */
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer unsigned int logdebuglevel = 0;
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = isc_taskmgr_createinctx(mctx, actx, 1, 0, &taskmgr);
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = isc_socketmgr_createinctx(mctx, actx, &socketmgr);
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = isc_timermgr_createinctx(mctx, actx, &timermgr);
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = isc_log_create(mctx, &lctx, &logconfig);
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = isc_log_usechannel(logconfig, "default_debug", NULL, NULL);
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = dns_client_createx(mctx, actx, taskmgr, socketmgr, timermgr,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer (*clientp)->attributes |= DNS_CLIENTATTR_OWNCTX;
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer /* client has its own reference to mctx, so we can detach it here */
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyerdns_client_createx(isc_mem_t *mctx, isc_appctx_t *actx, isc_taskmgr_t *taskmgr,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer isc_socketmgr_t *socketmgr, isc_timermgr_t *timermgr,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer unsigned int options, dns_client_t **clientp)
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = dns_client_createx2(mctx, actx, taskmgr, socketmgr, timermgr,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyerdns_client_createx2(isc_mem_t *mctx, isc_appctx_t *actx,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer isc_taskmgr_t *taskmgr, isc_socketmgr_t *socketmgr,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer isc_timermgr_t *timermgr, unsigned int options,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer dns_client_t **clientp, isc_sockaddr_t *localaddr4,
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson REQUIRE(clientp != NULL && *clientp == NULL);
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = isc_task_create(client->taskmgr, 0, &client->task);
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = dns_dispatchmgr_create(mctx, NULL, &dispatchmgr);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * If only one address family is specified, use it.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * If neither family is specified, or if both are, use both.
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson if (localaddr4 != NULL || localaddr6 == NULL) {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = getudpdispatch(AF_INET, dispatchmgr, socketmgr,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer if (localaddr6 != NULL || localaddr4 == NULL) {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = getudpdispatch(AF_INET6, dispatchmgr, socketmgr,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer /* We need at least one of the dispatchers */
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer if (dispatchv4 == NULL && dispatchv6 == NULL) {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer /* Create the default view for class IN */
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = dns_client_createview(mctx, dns_rdataclass_in, options,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer ISC_LIST_APPEND(client->viewlist, view, link);
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson client->update_timeout = DEF_UPDATE_TIMEOUT;
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer client->update_udptimeout = DEF_UPDATE_UDPTIMEOUT;
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer client->update_udpretries = DEF_UPDATE_UDPRETRIES;
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer client->find_udpretries = DEF_FIND_UDPRETRIES;
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson while ((view = ISC_LIST_HEAD(client->viewlist)) != NULL) {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer ISC_LIST_UNLINK(client->viewlist, view, link);
d821f1cd7e97552401296e880e7518c98c9ebea1Michael Sawyer dns_dispatchmgr_destroy(&client->dispatchmgr);
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * If the client has created its own running environments,
aa6054ec74819f754bcf19442ca9b39d948171adMichael Sawyer * destroy them.
aa6054ec74819f754bcf19442ca9b39d948171adMichael Sawyer if ((client->attributes & DNS_CLIENTATTR_OWNCTX) != 0) {
aa6054ec74819f754bcf19442ca9b39d948171adMichael Sawyer isc_mem_putanddetach(&client->mctx, client, sizeof(*client));
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer if (client->references == 0 && ISC_LIST_EMPTY(client->resctxs) &&
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerdns_client_setservers(dns_client_t *client, dns_rdataclass_t rdclass,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer dns_name_t *namespace, isc_sockaddrlist_t *addrs)
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = dns_viewlist_find(&client->viewlist, DNS_CLIENTVIEW_NAME,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = dns_fwdtable_add(view->fwdtable, namespace, addrs,
d821f1cd7e97552401296e880e7518c98c9ebea1Michael Sawyerdns_client_clearservers(dns_client_t *client, dns_rdataclass_t rdclass,
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer result = dns_viewlist_find(&client->viewlist, DNS_CLIENTVIEW_NAME,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = dns_fwdtable_delete(view->fwdtable, namespace);
aa6054ec74819f754bcf19442ca9b39d948171adMichael Sawyergetrdataset(isc_mem_t *mctx, dns_rdataset_t **rdatasetp) {
aa6054ec74819f754bcf19442ca9b39d948171adMichael Sawyer REQUIRE(rdatasetp != NULL && *rdatasetp == NULL);
cd720113a2fc8a781d4e33350b8a2b62857b31d8David Lawrence rdataset = isc_mem_get(mctx, sizeof(*rdataset));
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerputrdataset(isc_mem_t *mctx, dns_rdataset_t **rdatasetp) {
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer isc_mem_put(mctx, rdataset, sizeof(*rdataset));
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellingtonfetch_done(isc_task_t *task, isc_event_t *event) {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer REQUIRE(event->ev_type == DNS_EVENT_FETCHDONE);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * The caller must be holding the rctx's lock.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = dns_resolver_createfetch(rctx->view->resolver,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerview_find(resctx_t *rctx, dns_db_t **dbp, dns_dbnode_t **nodep,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer dns_name_t *name = dns_fixedname_name(&rctx->name);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = dns_view_find(rctx->view, name, type, 0, 0, ISC_FALSE,
5f01e77fc23fe9665fa2b8acd0a0c5bfbf61d61dBrian Wellingtonclient_resfind(resctx_t *rctx, dns_fetchevent_t *event) {
5f01e77fc23fe9665fa2b8acd0a0c5bfbf61d61dBrian Wellington isc_result_t tresult, result = ISC_R_SUCCESS;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer INSIST(!dns_rdataset_isassociated(rctx->rdataset));
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer !dns_rdataset_isassociated(rctx->sigrdataset));
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * We don't know anything about the name.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Launch a fetch.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer fname = dns_fixedname_name(&event->foundname);
e715e011788a529446b8013239c33599542ece32Michael Sawyer INSIST(event->sigrdataset == rctx->sigrdataset);
e715e011788a529446b8013239c33599542ece32Michael Sawyer * If we've been canceled, forget about the result.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Otherwise, get some resource for copying the
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer ansname = isc_mem_get(mctx, sizeof(*ansname));
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington tresult = dns_name_dup(aname, mctx, ansname);
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * This case is handled in the main line below.
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Add the CNAME to the answer list.
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington ISC_LIST_APPEND(ansname->list, rctx->rdataset, link);
88301f84d1391e96ec87a9a308aa18f45553a56bAndreas Gustafsson ISC_LIST_APPEND(rctx->namelist, ansname, link);
f8fec75ee8f429821137aee090f56ab678404a56Michael Sawyer * Copy the CNAME's target into the lookup's
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * query name and start over.
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington tresult = dns_rdata_tostruct(&rdata, &cname, NULL);
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington tresult = dns_name_copy(&cname.cname, name, NULL);
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Add the DNAME to the answer list.
&nlabels);
goto done;
goto done;
goto done;
case DNS_R_NCACHENXDOMAIN:
case DNS_R_NCACHENXRRSET:
goto done;
goto done;
&rdsiter);
goto done;
link);
goto done;
done:
!= NULL) {
if (want_restart) {
} while (want_restart);
if (send_event) {
return (ISC_R_NOMEMORY);
return (result);
return (result);
return (result);
return (result);
goto cleanup;
goto cleanup;
goto cleanup;
if (want_dnssec) {
goto cleanup;
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
if (need_destroyclient)
goto cleanup;
goto cleanup;
&dstkey);
goto cleanup;
return (result);
return (ISC_R_NOMEMORY);
return (result);
return (result);
return (result);
return (result);
goto cleanup;
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
if (need_destroyclient)
static isc_result_t
switch (rcode) {
case dns_rcode_formerr:
return (DNS_R_FORMERR);
case dns_rcode_servfail:
return (DNS_R_SERVFAIL);
case dns_rcode_nxdomain:
return (DNS_R_NXDOMAIN);
case dns_rcode_notimp:
return (DNS_R_NOTIMP);
case dns_rcode_refused:
return (DNS_R_REFUSED);
case dns_rcode_yxdomain:
return (DNS_R_YXDOMAIN);
case dns_rcode_yxrrset:
return (DNS_R_YXRRSET);
case dns_rcode_nxrrset:
return (DNS_R_NXRRSET);
case dns_rcode_notauth:
return (DNS_R_NOTAUTH);
case dns_rcode_notzone:
return (DNS_R_NOTZONE);
case dns_rcode_badvers:
return (DNS_R_BADVERS);
return (ISC_R_FAILURE);
unsigned int timeout;
goto out;
&answer);
goto out;
out:
NULL,
static isc_result_t
unsigned int timeout;
return (result);
return (result);
return (result);
return (result);
int family;
goto done;
sizeof(*sa));
goto done;
switch (family) {
case AF_INET:
NULL);
case AF_INET6:
NULL);
done:
if (completed) {
static isc_result_t
return (result);
return (result);
goto out;
&primary,
out:
return (result);
int pass = 0;
unsigned int nlabels;
goto out;
goto out;
NULL,
&newrequest);
goto out;
goto out;
if (pass == 0)
goto out;
pass++;
goto lookforsoa;
&soaset);
pass++;
goto lookforsoa;
if (seencname) {
goto out;
out:
if (droplabel) {
&tname);
static isc_result_t
&soaquery);
return (result);
goto fail;
goto fail;
return (ISC_R_SUCCESS);
fail:
return (result);
unsigned int nlabels;
goto out;
goto out;
&tname);
out:
static isc_result_t
isc_region_t r;
return (result);
goto fail;
goto fail;
goto fail;
goto fail;
r.length);
goto fail;
goto fail;
return (ISC_R_SUCCESS);
fail:
return (result);
return (ISC_R_NOMEMORY);
return (result);
return (result);
return (result);
return (result);
return (ISC_R_NOMEMORY);
return (ISC_R_NOMEMORY);
goto fail;
goto fail;
goto fail;
goto fail;
&newname);
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
return (ISC_R_SUCCESS);
fail:
return (result);
if (need_destroyclient)
return (ISC_R_NOMEMORY);
isc_region_t r;
switch (op) {
case updateop_add:
case updateop_delete:
ttl = 0;
case updateop_notexist:
case updateop_exist:
ttl = 0;
case updateop_none:
INSIST(0);
return (ISC_R_SUCCESS);