summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorInternet Software Consortium, Inc <@isc.org>2012-02-17 17:35:03 -0700
committerInternet Software Consortium, Inc <@isc.org>2012-02-17 17:35:03 -0700
commit42ae2295b467bd2b6132ece85d7f555a54682288 (patch)
tree8f5dcdbbbf469895ab94ee1860f5431fc850b07d /lib
parentc4acc4f1e2f6b8c7f3657cfe453c3ca164a9343a (diff)
downloadbind9-42ae2295b467bd2b6132ece85d7f555a54682288.tar.gz
9.9.0rc3
Diffstat (limited to 'lib')
-rw-r--r--lib/dns/api2
-rw-r--r--lib/dns/master.c14
-rw-r--r--lib/dns/rbtdb.c107
-rw-r--r--lib/dns/request.c12
-rw-r--r--lib/dns/resolver.c77
-rw-r--r--lib/dns/validator.c10
-rw-r--r--lib/dns/zone.c9
-rw-r--r--lib/isc/win32/socket.c15
8 files changed, 173 insertions, 73 deletions
diff --git a/lib/dns/api b/lib/dns/api
index 332a0c54..b0d8bdd7 100644
--- a/lib/dns/api
+++ b/lib/dns/api
@@ -4,5 +4,5 @@
# 9.8: 80-89
# 9.9: 90-109
LIBINTERFACE = 93
-LIBREVISION = 0
+LIBREVISION = 1
LIBAGE = 0
diff --git a/lib/dns/master.c b/lib/dns/master.c
index 4e1f274e..28df14f7 100644
--- a/lib/dns/master.c
+++ b/lib/dns/master.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2009, 2011 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: master.c,v 1.181 2011-12-08 16:07:20 each Exp $ */
+/* $Id: master.c,v 1.181.36.2 2012-02-14 23:46:49 tbox Exp $ */
/*! \file */
@@ -2283,14 +2283,14 @@ load_raw(dns_loadctx_t *lctx) {
if (rdcount > rdata_size) {
dns_rdata_t *new_rdata = NULL;
- new_rdata = grow_rdata(rdata_size + RDSZ, rdata,
+ new_rdata = grow_rdata(rdcount + RDSZ, rdata,
rdata_size, &head,
&dummy, mctx);
if (new_rdata == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup;
}
- rdata_size += RDSZ;
+ rdata_size = rdcount + RDSZ;
rdata = new_rdata;
}
@@ -2716,6 +2716,7 @@ grow_rdatalist(int new_len, dns_rdatalist_t *old, int old_len,
}
while ((this = ISC_LIST_HEAD(save)) != NULL) {
ISC_LIST_UNLINK(save, this, link);
+ INSIST(rdlcount < new_len);
new[rdlcount] = *this;
ISC_LIST_APPEND(*current, &new[rdlcount], link);
rdlcount++;
@@ -2728,6 +2729,7 @@ grow_rdatalist(int new_len, dns_rdatalist_t *old, int old_len,
}
while ((this = ISC_LIST_HEAD(save)) != NULL) {
ISC_LIST_UNLINK(save, this, link);
+ INSIST(rdlcount < new_len);
new[rdlcount] = *this;
ISC_LIST_APPEND(*glue, &new[rdlcount], link);
rdlcount++;
@@ -2771,6 +2773,7 @@ grow_rdata(int new_len, dns_rdata_t *old, int old_len,
}
while ((rdata = ISC_LIST_HEAD(save)) != NULL) {
ISC_LIST_UNLINK(save, rdata, link);
+ INSIST(rdcount < new_len);
new[rdcount] = *rdata;
ISC_LIST_APPEND(this->rdata, &new[rdcount], link);
rdcount++;
@@ -2790,13 +2793,14 @@ grow_rdata(int new_len, dns_rdata_t *old, int old_len,
}
while ((rdata = ISC_LIST_HEAD(save)) != NULL) {
ISC_LIST_UNLINK(save, rdata, link);
+ INSIST(rdcount < new_len);
new[rdcount] = *rdata;
ISC_LIST_APPEND(this->rdata, &new[rdcount], link);
rdcount++;
}
this = ISC_LIST_NEXT(this, link);
}
- INSIST(rdcount == old_len);
+ INSIST(rdcount == old_len || rdcount == 0);
if (old != NULL)
isc_mem_put(mctx, old, old_len * sizeof(*old));
return (new);
diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c
index 961fe1e3..3f87f068 100644
--- a/lib/dns/rbtdb.c
+++ b/lib/dns/rbtdb.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbtdb.c,v 1.326 2012-01-04 23:46:49 tbox Exp $ */
+/* $Id: rbtdb.c,v 1.326.16.4 2012-02-15 12:29:39 marka Exp $ */
/*! \file */
@@ -1608,8 +1608,7 @@ cleanup_dead_nodes(dns_rbtdb_t *rbtdb, int bucketnum) {
}
/*
- * Caller must be holding the node lock if its reference must be protected
- * by the lock.
+ * Caller must be holding the node lock.
*/
static inline void
new_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
@@ -1640,31 +1639,43 @@ static inline void
reactivate_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
isc_rwlocktype_t treelocktype)
{
- isc_boolean_t need_relock = ISC_FALSE;
+ isc_rwlocktype_t locktype = isc_rwlocktype_read;
+ nodelock_t *nodelock = &rbtdb->node_locks[node->locknum].lock;
+ isc_boolean_t maybe_cleanup = ISC_FALSE;
- NODE_STRONGLOCK(&rbtdb->node_locks[node->locknum].lock);
- NODE_WEAKLOCK(&rbtdb->node_locks[node->locknum].lock,
- isc_rwlocktype_read);
- if (ISC_LINK_LINKED(node, deadlink))
- need_relock = ISC_TRUE;
- else if (!ISC_LIST_EMPTY(rbtdb->deadnodes[node->locknum]) &&
- treelocktype == isc_rwlocktype_write)
- need_relock = ISC_TRUE;
- NODE_WEAKUNLOCK(&rbtdb->node_locks[node->locknum].lock,
- isc_rwlocktype_read);
- if (need_relock) {
- NODE_WEAKLOCK(&rbtdb->node_locks[node->locknum].lock,
- isc_rwlocktype_write);
+ POST(locktype);
+
+ NODE_STRONGLOCK(nodelock);
+ NODE_WEAKLOCK(nodelock, locktype);
+
+ /*
+ * Check if we can possibly cleanup the dead node. If so, upgrade
+ * the node lock below to perform the cleanup.
+ */
+ if (!ISC_LIST_EMPTY(rbtdb->deadnodes[node->locknum]) &&
+ treelocktype == isc_rwlocktype_write) {
+ maybe_cleanup = ISC_TRUE;
+ }
+
+ if (ISC_LINK_LINKED(node, deadlink) || maybe_cleanup) {
+ /*
+ * Upgrade the lock and test if we still need to unlink.
+ */
+ NODE_WEAKUNLOCK(nodelock, locktype);
+ locktype = isc_rwlocktype_write;
+ POST(locktype);
+ NODE_WEAKLOCK(nodelock, locktype);
if (ISC_LINK_LINKED(node, deadlink))
ISC_LIST_UNLINK(rbtdb->deadnodes[node->locknum],
node, deadlink);
- if (treelocktype == isc_rwlocktype_write)
+ if (maybe_cleanup)
cleanup_dead_nodes(rbtdb, node->locknum);
- NODE_WEAKUNLOCK(&rbtdb->node_locks[node->locknum].lock,
- isc_rwlocktype_write);
}
+
new_reference(rbtdb, node);
- NODE_STRONGUNLOCK(&rbtdb->node_locks[node->locknum].lock);
+
+ NODE_WEAKUNLOCK(nodelock, locktype);
+ NODE_STRONGUNLOCK(nodelock);
}
/*
@@ -1688,7 +1699,7 @@ decrement_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
rbtdb_nodelock_t *nodelock;
unsigned int refs, nrefs;
int bucket = node->locknum;
- isc_boolean_t no_reference;
+ isc_boolean_t no_reference = ISC_TRUE;
nodelock = &rbtdb->node_locks[bucket];
@@ -1708,6 +1719,7 @@ decrement_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
NODE_WEAKUNLOCK(&nodelock->lock, isc_rwlocktype_read);
NODE_WEAKLOCK(&nodelock->lock, isc_rwlocktype_write);
}
+
dns_rbtnode_refdecrement(node, &nrefs);
INSIST((int)nrefs >= 0);
if (nrefs > 0) {
@@ -1717,7 +1729,7 @@ decrement_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
return (ISC_FALSE);
}
- if (node->dirty && dns_rbtnode_refcurrent(node) == 0) {
+ if (node->dirty) {
if (IS_CACHE(rbtdb))
clean_cache_node(rbtdb, node);
else {
@@ -1735,19 +1747,6 @@ decrement_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
}
}
- isc_refcount_decrement(&nodelock->references, &refs);
- INSIST((int)refs >= 0);
-
- /*
- * XXXDCL should this only be done for cache zones?
- */
- if (node->data != NULL || node->down != NULL) {
- /* Restore the lock? */
- if (nlock == isc_rwlocktype_read)
- NODE_WEAKDOWNGRADE(&nodelock->lock);
- return (ISC_TRUE);
- }
-
/*
* Attempt to switch to a write lock on the tree. If this fails,
* we will add this node to a linked list of nodes in this locking
@@ -1771,13 +1770,18 @@ decrement_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
} else
write_locked = ISC_TRUE;
- no_reference = ISC_TRUE;
- if (write_locked && dns_rbtnode_refcurrent(node) == 0) {
+ isc_refcount_decrement(&nodelock->references, &refs);
+ INSIST((int)refs >= 0);
+
+ /*
+ * XXXDCL should this only be done for cache zones?
+ */
+ if (node->data != NULL || node->down != NULL)
+ goto restore_locks;
+
+ if (write_locked) {
/*
- * We can now delete the node if the reference counter is
- * zero. This should be typically the case, but a different
- * thread may still gain a (new) reference just before the
- * current thread locks the tree (e.g., in findnode()).
+ * We can now delete the node.
*/
/*
@@ -1852,13 +1856,13 @@ decrement_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
delete_node(rbtdb, node);
}
- } else if (dns_rbtnode_refcurrent(node) == 0) {
+ } else {
INSIST(node->data == NULL);
INSIST(!ISC_LINK_LINKED(node, deadlink));
ISC_LIST_APPEND(rbtdb->deadnodes[bucket], node, deadlink);
- } else
- no_reference = ISC_FALSE;
+ }
+ restore_locks:
/* Restore the lock? */
if (nlock == isc_rwlocktype_read)
NODE_WEAKDOWNGRADE(&nodelock->lock);
@@ -6126,6 +6130,19 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion,
addedrdataset);
return (ISC_R_SUCCESS);
}
+ /*
+ * If we have will be replacing a NS RRset force its TTL
+ * to be no more than the current NS RRset's TTL. This
+ * ensures the delegations that are withdrawn are honoured.
+ */
+ if (IS_CACHE(rbtdb) && header->rdh_ttl > now &&
+ header->type == dns_rdatatype_ns &&
+ !header_nx && !newheader_nx &&
+ header->trust <= newheader->trust) {
+ if (newheader->rdh_ttl > header->rdh_ttl) {
+ newheader->rdh_ttl = header->rdh_ttl;
+ }
+ }
if (IS_CACHE(rbtdb) && header->rdh_ttl > now &&
(header->type == dns_rdatatype_a ||
header->type == dns_rdatatype_aaaa) &&
diff --git a/lib/dns/request.c b/lib/dns/request.c
index ec850e07..4ca497bd 100644
--- a/lib/dns/request.c
+++ b/lib/dns/request.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: request.c,v 1.89 2011-03-12 04:59:48 tbox Exp $ */
+/* $Id: request.c,v 1.89.250.2 2012-02-07 23:46:57 tbox Exp $ */
/*! \file */
@@ -1133,9 +1133,7 @@ req_render(dns_message_t *message, isc_buffer_t **bufferp,
*/
static void
send_if_done(dns_request_t *request, isc_result_t result) {
- if (!DNS_REQUEST_CONNECTING(request) &&
- !DNS_REQUEST_SENDING(request) &&
- !request->canceling)
+ if (request->event != NULL && !request->canceling)
req_sendevent(request, result);
}
@@ -1319,8 +1317,8 @@ req_senddone(isc_task_t *task, isc_event_t *event) {
else
send_if_done(request, ISC_R_CANCELED);
} else if (sevent->result != ISC_R_SUCCESS) {
- req_cancel(request);
- send_if_done(request, ISC_R_CANCELED);
+ req_cancel(request);
+ send_if_done(request, ISC_R_CANCELED);
}
UNLOCK(&request->requestmgr->locks[request->hash]);
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
index c97aa780..f560b41a 100644
--- a/lib/dns/resolver.c
+++ b/lib/dns/resolver.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: resolver.c,v 1.446 2011-12-07 23:08:42 marka Exp $ */
+/* $Id: resolver.c,v 1.446.38.2 2012-02-14 23:46:49 tbox Exp $ */
/*! \file */
@@ -216,6 +216,8 @@ struct fetchctx {
ISC_LIST(dns_validator_t) validators;
dns_db_t * cache;
dns_adb_t * adb;
+ isc_boolean_t ns_ttl_ok;
+ isc_uint32_t ns_ttl;
/*%
* The number of events we're waiting for.
@@ -3443,6 +3445,20 @@ fctx_join(fetchctx_t *fctx, isc_task_t *task, isc_sockaddr_t *client,
return (ISC_R_SUCCESS);
}
+static inline void
+log_ns_ttl(fetchctx_t *fctx, const char *where) {
+ char namebuf[DNS_NAME_FORMATSIZE];
+ char domainbuf[DNS_NAME_FORMATSIZE];
+
+ dns_name_format(&fctx->name, namebuf, sizeof(namebuf));
+ dns_name_format(&fctx->domain, domainbuf, sizeof(domainbuf));
+ isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
+ DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(10),
+ "log_ns_ttl: fctx %p: %s: %s (in '%s'?): %u %u",
+ fctx, where, namebuf, domainbuf,
+ fctx->ns_ttl_ok, fctx->ns_ttl);
+}
+
static isc_result_t
fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
dns_name_t *domain, dns_rdataset_t *nameservers,
@@ -3536,6 +3552,8 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
fctx->timeout = ISC_FALSE;
fctx->addrinfo = NULL;
fctx->client = NULL;
+ fctx->ns_ttl = 0;
+ fctx->ns_ttl_ok = ISC_FALSE;
dns_name_init(&fctx->nsname, NULL);
fctx->nsfetch = NULL;
@@ -3585,6 +3603,8 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
dns_rdataset_disassociate(&fctx->nameservers);
goto cleanup_name;
}
+ fctx->ns_ttl = fctx->nameservers.ttl;
+ fctx->ns_ttl_ok = ISC_TRUE;
} else {
/*
* We're in forward-only mode. Set the query domain.
@@ -3602,8 +3622,12 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
if (result != ISC_R_SUCCESS)
goto cleanup_name;
dns_rdataset_clone(nameservers, &fctx->nameservers);
+ fctx->ns_ttl = fctx->nameservers.ttl;
+ fctx->ns_ttl_ok = ISC_TRUE;
}
+ log_ns_ttl(fctx, "fctx_create");
+
INSIST(dns_name_issubdomain(&fctx->name, &fctx->domain));
fctx->qmessage = NULL;
@@ -5280,6 +5304,26 @@ is_answertarget_allowed(dns_view_t *view, dns_name_t *name,
return (ISC_TRUE);
}
+static void
+trim_ns_ttl(fetchctx_t *fctx, dns_name_t *name, dns_rdataset_t *rdataset) {
+ char ns_namebuf[DNS_NAME_FORMATSIZE];
+ char namebuf[DNS_NAME_FORMATSIZE];
+ char tbuf[DNS_RDATATYPE_FORMATSIZE];
+
+ if (fctx->ns_ttl_ok && rdataset->ttl > fctx->ns_ttl) {
+ dns_name_format(name, ns_namebuf, sizeof(ns_namebuf));
+ dns_name_format(&fctx->name, namebuf, sizeof(namebuf));
+ dns_rdatatype_format(fctx->type, tbuf, sizeof(tbuf));
+
+ isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
+ DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(10),
+ "fctx %p: trimming ttl of %s/NS for %s/%s: "
+ "%u -> %u", fctx, ns_namebuf, namebuf, tbuf,
+ rdataset->ttl, fctx->ns_ttl);
+ rdataset->ttl = fctx->ns_ttl;
+ }
+}
+
/*
* Handle a no-answer response (NXDOMAIN, NXRRSET, or referral).
* If look_in_options has LOOK_FOR_NS_IN_ANSWER then we look in the answer
@@ -5466,6 +5510,12 @@ noanswer_response(fetchctx_t *fctx, dns_name_t *oqname,
return (result);
}
+ log_ns_ttl(fctx, "noanswer_response");
+
+ if (ns_rdataset != NULL && dns_name_equal(&fctx->domain, ns_name) &&
+ !dns_name_equal(ns_name, dns_rootname))
+ trim_ns_ttl(fctx, ns_name, ns_rdataset);
+
/*
* A negative response has a SOA record (Type 2)
* and a optional NS RRset (Type 1) or it has neither
@@ -5684,6 +5734,8 @@ noanswer_response(fetchctx_t *fctx, dns_name_t *oqname,
if (result != ISC_R_SUCCESS)
return (result);
fctx->attributes |= FCTX_ATTR_WANTCACHE;
+ fctx->ns_ttl_ok = ISC_FALSE;
+ log_ns_ttl(fctx, "DELEGATION");
return (DNS_R_DELEGATION);
}
@@ -5704,8 +5756,8 @@ static isc_result_t
answer_response(fetchctx_t *fctx) {
isc_result_t result;
dns_message_t *message;
- dns_name_t *name, *qname, tname;
- dns_rdataset_t *rdataset;
+ dns_name_t *name, *qname, tname, *ns_name;
+ dns_rdataset_t *rdataset, *ns_rdataset;
isc_boolean_t done, external, chaining, aa, found, want_chaining;
isc_boolean_t have_answer, found_cname, found_type, wanted_chaining;
unsigned int aflag;
@@ -6105,6 +6157,8 @@ answer_response(fetchctx_t *fctx) {
* in this section, and we expect that it is not external.
*/
done = ISC_FALSE;
+ ns_name = NULL;
+ ns_rdataset = NULL;
result = dns_message_firstname(message, DNS_SECTION_AUTHORITY);
while (!done && result == ISC_R_SUCCESS) {
name = NULL;
@@ -6132,6 +6186,10 @@ answer_response(fetchctx_t *fctx) {
rdataset->trust =
dns_trust_additional;
+ if (rdataset->type == dns_rdatatype_ns) {
+ ns_name = name;
+ ns_rdataset = rdataset;
+ }
/*
* Mark any additional data related
* to this rdataset.
@@ -6149,6 +6207,12 @@ answer_response(fetchctx_t *fctx) {
if (result == ISC_R_NOMORE)
result = ISC_R_SUCCESS;
+ log_ns_ttl(fctx, "answer_response");
+
+ if (ns_rdataset != NULL && dns_name_equal(&fctx->domain, ns_name) &&
+ !dns_name_equal(ns_name, dns_rootname))
+ trim_ns_ttl(fctx, ns_name, ns_rdataset);
+
return (result);
}
@@ -6220,6 +6284,9 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
if (dns_rdataset_isassociated(&fctx->nameservers))
dns_rdataset_disassociate(&fctx->nameservers);
dns_rdataset_clone(fevent->rdataset, &fctx->nameservers);
+ fctx->ns_ttl = fctx->nameservers.ttl;
+ fctx->ns_ttl_ok = ISC_TRUE;
+ log_ns_ttl(fctx, "resume_dslookup");
dns_name_free(&fctx->domain,
fctx->res->buckets[bucketnum].mctx);
dns_name_init(&fctx->domain, NULL);
@@ -7153,6 +7220,8 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
return;
}
+ fctx->ns_ttl = fctx->nameservers.ttl;
+ fctx->ns_ttl_ok = ISC_TRUE;
fctx_cancelqueries(fctx, ISC_TRUE);
fctx_cleanupfinds(fctx);
fctx_cleanupaltfinds(fctx);
diff --git a/lib/dns/validator.c b/lib/dns/validator.c
index efb4ad2b..c049b013 100644
--- a/lib/dns/validator.c
+++ b/lib/dns/validator.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: validator.c,v 1.208 2011-11-04 05:36:28 each Exp $ */
+/* $Id: validator.c,v 1.208.72.1 2012-02-15 21:01:50 marka Exp $ */
#include <config.h>
@@ -3743,9 +3743,8 @@ proveunsecure(dns_validator_t *val, isc_boolean_t have_ds, isc_boolean_t resume)
result = ISC_R_SUCCESS;
goto out;
}
- result = startfinddlvsep(val,
- dns_fixedname_name(&val->fname));
- goto out;
+ return(startfinddlvsep(val,
+ dns_fixedname_name(&val->fname)));
}
val->labels++;
}
@@ -3881,8 +3880,7 @@ proveunsecure(dns_validator_t *val, isc_boolean_t have_ds, isc_boolean_t resume)
result = ISC_R_SUCCESS;
goto out;
}
- result = startfinddlvsep(val, tname);
- goto out;
+ return(startfinddlvsep(val, tname));
}
continue;
}
diff --git a/lib/dns/zone.c b/lib/dns/zone.c
index 171ea698..9c75a8c2 100644
--- a/lib/dns/zone.c
+++ b/lib/dns/zone.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zone.c,v 1.667.2.1 2012-01-31 01:11:55 each Exp $ */
+/* $Id: zone.c,v 1.667.2.2 2012-02-07 00:52:05 marka Exp $ */
/*! \file */
@@ -1690,7 +1690,7 @@ zone_asyncload(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
if (result == ISC_R_CANCELED ||
!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADPENDING))
- return;
+ goto cleanup;
zone_load(zone, 0);
@@ -1702,7 +1702,9 @@ zone_asyncload(isc_task_t *task, isc_event_t *event) {
if (asl->loaded != NULL)
(asl->loaded)(asl->loaded_arg, zone, task);
+ cleanup:
isc_mem_put(zone->mctx, asl, sizeof (*asl));
+ dns_zone_idetach(&zone);
}
isc_result_t
@@ -1720,7 +1722,7 @@ dns_zone_asyncload(dns_zone_t *zone, dns_zt_zoneloaded_t done, void *arg) {
if (asl == NULL)
CHECK(ISC_R_NOMEMORY);
- asl->zone = zone;
+ asl->zone = NULL;
asl->loaded = done;
asl->loaded_arg = arg;
@@ -1732,6 +1734,7 @@ dns_zone_asyncload(dns_zone_t *zone, dns_zt_zoneloaded_t done, void *arg) {
CHECK(ISC_R_NOMEMORY);
LOCK_ZONE(zone);
+ zone_iattach(zone, &asl->zone);
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADPENDING);
isc_task_send(zone->loadtask, &e);
UNLOCK_ZONE(zone);
diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c
index c6426a1d..0c5d1a49 100644
--- a/lib/isc/win32/socket.c
+++ b/lib/isc/win32/socket.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.c,v 1.93 2011-11-29 01:03:47 marka Exp $ */
+/* $Id: socket.c,v 1.93.52.2 2012-02-06 23:46:23 tbox Exp $ */
/* This code uses functions which are only available on Server 2003 and
* higher, and Windows XP and higher.
@@ -1649,12 +1649,17 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
REQUIRE(socketp != NULL && *socketp == NULL);
REQUIRE(type != isc_sockettype_fdwatch);
+ if (dup_socket != NULL)
+ return (ISC_R_NOTIMPLEMENTED);
+
result = allocate_socket(manager, type, &sock);
if (result != ISC_R_SUCCESS)
return (result);
sock->pf = pf;
+#if 0
if (dup_socket == NULL) {
+#endif
switch (type) {
case isc_sockettype_udp:
sock->fd = socket(pf, SOCK_DGRAM, IPPROTO_UDP);
@@ -1680,6 +1685,7 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
sock->fd = socket(pf, SOCK_STREAM, IPPROTO_TCP);
break;
}
+#if 0
} else {
/*
* XXX: dup() is deprecated in windows, use _dup()
@@ -1690,6 +1696,7 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type,
sock->dupped = 1;
sock->bound = dup_socket->bound;
}
+#endif
if (sock->fd == INVALID_SOCKET) {
socket_errno = WSAGetLastError();
@@ -1826,8 +1833,12 @@ isc__socket_dup(isc_socket_t *sock, isc_socket_t **socketp) {
REQUIRE(VALID_SOCKET(sock));
REQUIRE(socketp != NULL && *socketp == NULL);
+#if 1
+ return (ISC_R_NOTIMPLEMENTED);
+#else
return (socket_create(sock->manager, sock->pf, sock->type,
socketp, sock));
+#endif
}
isc_result_t