summaryrefslogtreecommitdiffstats
path: root/contrib/bind9/lib/dns/view.c
diff options
context:
space:
mode:
authorerwin <erwin@FreeBSD.org>2013-08-06 06:22:54 +0000
committererwin <erwin@FreeBSD.org>2013-08-06 06:22:54 +0000
commitef27886236495d424b7f096da332d093109780a6 (patch)
treeb4ab3fc36f81b1377b903cb2fe0ca445c0304cbd /contrib/bind9/lib/dns/view.c
parentc116c25dd59e2f090a93b32234e356ae28d96a02 (diff)
parent414d5ed7dd8cad7ef2738c53f9b9ecfe246ed91c (diff)
downloadFreeBSD-src-ef27886236495d424b7f096da332d093109780a6.zip
FreeBSD-src-ef27886236495d424b7f096da332d093109780a6.tar.gz
Update Bind to 9.8.5-P2
New Features Adds a new configuration option, "check-spf"; valid values are "warn" (default) and "ignore". When set to "warn", checks SPF and TXT records in spf format, warning if either resource record type occurs without a corresponding record of the other resource record type. [RT #33355] Adds support for Uniform Resource Identifier (URI) resource records. [RT #23386] Adds support for the EUI48 and EUI64 RR types. [RT #33082] Adds support for the RFC 6742 ILNP record types (NID, LP, L32, and L64). [RT #31836] Feature Changes Changes timing of when slave zones send NOTIFY messages after loading a new copy of the zone. They now send the NOTIFY before writing the zone data to disk. This will result in quicker propagation of updates in multi-level server structures. [RT #27242] "named -V" can now report a source ID string. (This is will be of most interest to developers and troubleshooters). The source ID for ISC's production versions of BIND is defined in the "srcid" file in the build tree and is normally set to the most recent git hash. [RT #31494] Response Policy Zone performance enhancements. New "response-policy" option "min-ns-dots". "nsip" and "nsdname" now enabled by default with RPZ. [RT #32251] Approved by: delphij (mentor) Sponsored by: DK Hostmaster A/S
Diffstat (limited to 'contrib/bind9/lib/dns/view.c')
-rw-r--r--contrib/bind9/lib/dns/view.c48
1 files changed, 35 insertions, 13 deletions
diff --git a/contrib/bind9/lib/dns/view.c b/contrib/bind9/lib/dns/view.c
index 6750058..5b6ad65 100644
--- a/contrib/bind9/lib/dns/view.c
+++ b/contrib/bind9/lib/dns/view.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -86,6 +86,9 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
view = isc_mem_get(mctx, sizeof(*view));
if (view == NULL)
return (ISC_R_NOMEMORY);
+
+ view->mctx = NULL;
+ isc_mem_attach(mctx, &view->mctx);
view->name = isc_mem_strdup(mctx, name);
if (view->name == NULL) {
result = ISC_R_NOMEMORY;
@@ -95,8 +98,8 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
if (result != ISC_R_SUCCESS)
goto cleanup_name;
-#ifdef BIND9
view->zonetable = NULL;
+#ifdef BIND9
result = dns_zt_create(mctx, rdclass, &view->zonetable);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
@@ -125,7 +128,6 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
view->resolver = NULL;
view->adb = NULL;
view->requestmgr = NULL;
- view->mctx = mctx;
view->rdclass = rdclass;
view->frozen = ISC_FALSE;
view->task = NULL;
@@ -225,6 +227,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
ISC_EVENT_INIT(&view->reqevent, sizeof(view->reqevent), 0, NULL,
DNS_EVENT_VIEWREQSHUTDOWN, req_shutdown,
view, NULL, NULL, NULL);
+ view->viewlist = NULL;
view->magic = DNS_VIEW_MAGIC;
*viewp = view;
@@ -260,7 +263,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
isc_mem_free(mctx, view->name);
cleanup_view:
- isc_mem_put(mctx, view, sizeof(*view));
+ isc_mem_putanddetach(&view->mctx, view, sizeof(*view));
return (result);
}
@@ -439,7 +442,7 @@ destroy(dns_view_t *view) {
DESTROYLOCK(&view->lock);
isc_refcount_destroy(&view->references);
isc_mem_free(view->mctx, view->name);
- isc_mem_put(view->mctx, view, sizeof(*view));
+ isc_mem_putanddetach(&view->mctx, view, sizeof(*view));
}
/*
@@ -482,6 +485,10 @@ view_flushanddetach(dns_view_t **viewp, isc_boolean_t flush) {
view->flush = ISC_TRUE;
isc_refcount_decrement(&view->references, &refs);
if (refs == 0) {
+#ifdef BIND9
+ dns_zone_t *mkzone = NULL;
+#endif
+
LOCK(&view->lock);
if (!RESSHUTDOWN(view))
dns_resolver_shutdown(view->resolver);
@@ -497,13 +504,20 @@ view_flushanddetach(dns_view_t **viewp, isc_boolean_t flush) {
else
dns_zt_detach(&view->zonetable);
if (view->managed_keys != NULL) {
+ mkzone = view->managed_keys;
+ view->managed_keys = NULL;
if (view->flush)
- dns_zone_flush(view->managed_keys);
- dns_zone_detach(&view->managed_keys);
+ dns_zone_flush(mkzone);
}
#endif
done = all_done(view);
UNLOCK(&view->lock);
+
+#ifdef BIND9
+ /* Need to detach zones outside view lock */
+ if (mkzone != NULL)
+ dns_zone_detach(&mkzone);
+#endif
}
*viewp = NULL;
@@ -855,11 +869,14 @@ dns_view_findzone(dns_view_t *view, dns_name_t *name, dns_zone_t **zonep) {
REQUIRE(DNS_VIEW_VALID(view));
- result = dns_zt_find(view->zonetable, name, 0, NULL, zonep);
- if (result == DNS_R_PARTIALMATCH) {
- dns_zone_detach(zonep);
+ if (view->zonetable != NULL) {
+ result = dns_zt_find(view->zonetable, name, 0, NULL, zonep);
+ if (result == DNS_R_PARTIALMATCH) {
+ dns_zone_detach(zonep);
+ result = ISC_R_NOTFOUND;
+ }
+ } else
result = ISC_R_NOTFOUND;
- }
return (result);
}
@@ -892,6 +909,7 @@ dns_view_find2(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
#ifndef BIND9
UNUSED(use_hints);
UNUSED(use_static_stub);
+ UNUSED(zone);
#endif
/*
@@ -916,11 +934,11 @@ dns_view_find2(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
/*
* Find a database to answer the query.
*/
- zone = NULL;
db = NULL;
node = NULL;
is_staticstub_zone = ISC_FALSE;
#ifdef BIND9
+ zone = NULL;
result = dns_zt_find(view->zonetable, name, 0, NULL, &zone);
if (zone != NULL && dns_zone_gettype(zone) == dns_zone_staticstub &&
!use_static_stub) {
@@ -1168,11 +1186,14 @@ dns_view_findzonecut2(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
dns_rdataset_t zrdataset, zsigrdataset;
dns_fixedname_t zfixedname;
+#ifndef BIND9
+ UNUSED(zone);
+#endif
+
REQUIRE(DNS_VIEW_VALID(view));
REQUIRE(view->frozen);
db = NULL;
- zone = NULL;
use_zone = ISC_FALSE;
try_hints = ISC_FALSE;
zfname = NULL;
@@ -1188,6 +1209,7 @@ dns_view_findzonecut2(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
* Find the right database.
*/
#ifdef BIND9
+ zone = NULL;
result = dns_zt_find(view->zonetable, name, 0, NULL, &zone);
if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH)
result = dns_zone_getdb(zone, &db);
OpenPOWER on IntegriCloud