2007-04-24 11:12:38 +00:00
|
|
|
--- bind-9.4.0/lib/dns/view.c.freeze 2007-04-24 12:35:03.000000000 +0200
|
|
|
|
+++ bind-9.4.0/lib/dns/view.c 2007-04-24 12:52:02.000000000 +0200
|
|
|
|
@@ -1140,6 +1140,32 @@
|
2007-04-18 11:25:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
isc_result_t
|
2007-04-24 11:12:38 +00:00
|
|
|
+dns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name, isc_boolean_t allclasses,
|
2007-04-18 11:25:21 +00:00
|
|
|
+ dns_rdataclass_t rdclass, dns_zone_t **zonep)
|
|
|
|
+{
|
|
|
|
+ dns_view_t *view;
|
|
|
|
+ isc_result_t result;
|
2007-04-24 11:12:38 +00:00
|
|
|
+ isc_boolean_t match = isc_boolean_false;
|
2007-04-18 11:25:21 +00:00
|
|
|
+
|
|
|
|
+ REQUIRE(list != NULL);
|
|
|
|
+
|
|
|
|
+ for (view = ISC_LIST_HEAD(*list);
|
|
|
|
+ view != NULL;
|
|
|
|
+ view = ISC_LIST_NEXT(view, link)) {
|
2007-04-24 11:12:38 +00:00
|
|
|
+ if (allclasses == isc_boolean_false && view->rdclass != rdclass )
|
2007-04-18 11:25:21 +00:00
|
|
|
+ continue;
|
|
|
|
+ result = dns_zt_find(view->zonetable, name,
|
|
|
|
+ 0, NULL, zonep);
|
2007-04-24 11:12:38 +00:00
|
|
|
+ if(result == ISC_R_SUCCESS) {
|
|
|
|
+ if (match != isc_boolean_false)
|
|
|
|
+ return ISC_R_NOTFOUND;
|
|
|
|
+ match = isc_boolean_true;
|
|
|
|
+ }
|
2007-04-18 11:25:21 +00:00
|
|
|
+ }
|
2007-04-24 11:12:38 +00:00
|
|
|
+ return (match == isc_boolean_false) ? ISC_R_NOTFOUND : ISC_R_SUCCESS;
|
2007-04-18 11:25:21 +00:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
+isc_result_t
|
|
|
|
dns_view_load(dns_view_t *view, isc_boolean_t stop) {
|
|
|
|
|
|
|
|
REQUIRE(DNS_VIEW_VALID(view));
|
2007-04-24 11:12:38 +00:00
|
|
|
--- bind-9.4.0/lib/dns/include/dns/view.h.freeze 2007-04-24 12:35:03.000000000 +0200
|
|
|
|
+++ bind-9.4.0/lib/dns/include/dns/view.h 2007-04-24 12:35:03.000000000 +0200
|
2007-04-18 11:25:21 +00:00
|
|
|
@@ -592,6 +592,19 @@
|
|
|
|
*/
|
|
|
|
|
|
|
|
isc_result_t
|
2007-04-24 11:12:38 +00:00
|
|
|
+dns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name, isc_boolean_t allclasses,
|
2007-04-18 11:25:21 +00:00
|
|
|
+ dns_rdataclass_t rdclass, dns_zone_t **zonep);
|
|
|
|
+
|
|
|
|
+/*%<
|
|
|
|
+ * Search zone with 'name' in view with 'rdclass' in viewlist 'list'
|
2007-04-24 11:12:38 +00:00
|
|
|
+ * If found, zone is returned in *zonep. If allclasses is set rdclass is ignored
|
2007-04-18 11:25:21 +00:00
|
|
|
+ *
|
|
|
|
+ * Returns:
|
|
|
|
+ *\li #ISC_R_SUCCESS A matching zone was found.
|
|
|
|
+ *\li #ISC_R_NOTFOUND No matching zone was found.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+isc_result_t
|
|
|
|
dns_view_findzone(dns_view_t *view, dns_name_t *name, dns_zone_t **zonep);
|
|
|
|
/*%<
|
|
|
|
* Search for the zone 'name' in the zone table of 'view'.
|
2007-04-24 11:12:38 +00:00
|
|
|
--- bind-9.4.0/bin/named/server.c.freeze 2007-04-24 12:35:03.000000000 +0200
|
|
|
|
+++ bind-9.4.0/bin/named/server.c 2007-04-24 12:35:03.000000000 +0200
|
|
|
|
@@ -3922,19 +3922,24 @@
|
2007-04-18 11:25:21 +00:00
|
|
|
rdclass = dns_rdataclass_in;
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (viewtxt == NULL)
|
|
|
|
- viewtxt = "_default";
|
|
|
|
- result = dns_viewlist_find(&server->viewlist, viewtxt,
|
|
|
|
- rdclass, &view);
|
|
|
|
- if (result != ISC_R_SUCCESS)
|
|
|
|
- goto fail1;
|
|
|
|
+ if (viewtxt == NULL) {
|
|
|
|
+ result = dns_viewlist_findzone(&server->viewlist, dns_fixedname_name(&name),
|
2007-04-24 11:12:38 +00:00
|
|
|
+ (classtxt == NULL) ? isc_boolean_true : isc_boolean_false,
|
2007-04-18 11:25:21 +00:00
|
|
|
+ rdclass, zonep);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ result = dns_viewlist_find(&server->viewlist, viewtxt,
|
|
|
|
+ rdclass, &view);
|
|
|
|
+ if (result != ISC_R_SUCCESS)
|
|
|
|
+ goto fail1;
|
|
|
|
|
|
|
|
- result = dns_zt_find(view->zonetable, dns_fixedname_name(&name),
|
|
|
|
- 0, NULL, zonep);
|
|
|
|
+ result = dns_zt_find(view->zonetable, dns_fixedname_name(&name),
|
|
|
|
+ 0, NULL, zonep);
|
|
|
|
+ dns_view_detach(&view);
|
|
|
|
+ }
|
|
|
|
/* Partial match? */
|
|
|
|
if (result != ISC_R_SUCCESS && *zonep != NULL)
|
|
|
|
dns_zone_detach(zonep);
|
|
|
|
- dns_view_detach(&view);
|
|
|
|
fail1:
|
|
|
|
return (result);
|
|
|
|
}
|
2007-04-24 11:12:38 +00:00
|
|
|
--- bind-9.4.0/bin/named_sdb/server.c.freeze 2007-04-24 12:35:03.000000000 +0200
|
|
|
|
+++ bind-9.4.0/bin/named_sdb/server.c 2007-04-24 12:35:03.000000000 +0200
|
|
|
|
@@ -3917,19 +3917,24 @@
|
2007-04-18 11:25:21 +00:00
|
|
|
rdclass = dns_rdataclass_in;
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (viewtxt == NULL)
|
|
|
|
- viewtxt = "_default";
|
|
|
|
- result = dns_viewlist_find(&server->viewlist, viewtxt,
|
|
|
|
- rdclass, &view);
|
|
|
|
- if (result != ISC_R_SUCCESS)
|
|
|
|
- goto fail1;
|
|
|
|
-
|
|
|
|
- result = dns_zt_find(view->zonetable, dns_fixedname_name(&name),
|
|
|
|
- 0, NULL, zonep);
|
|
|
|
+ if (viewtxt == NULL) {
|
|
|
|
+ result = dns_viewlist_findzone(&server->viewlist, dns_fixedname_name(&name),
|
2007-04-24 11:12:38 +00:00
|
|
|
+ (classtxt == NULL) ? isc_boolean_true : isc_boolean_false,
|
2007-04-18 11:25:21 +00:00
|
|
|
+ rdclass, zonep);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ result = dns_viewlist_find(&server->viewlist, viewtxt,
|
|
|
|
+ rdclass, &view);
|
|
|
|
+ if (result != ISC_R_SUCCESS)
|
|
|
|
+ goto fail1;
|
|
|
|
+
|
|
|
|
+ result = dns_zt_find(view->zonetable, dns_fixedname_name(&name),
|
|
|
|
+ 0, NULL, zonep);
|
|
|
|
+ dns_view_detach(&view);
|
|
|
|
+ }
|
|
|
|
/* Partial match? */
|
|
|
|
if (result != ISC_R_SUCCESS && *zonep != NULL)
|
|
|
|
dns_zone_detach(zonep);
|
2007-04-24 11:12:38 +00:00
|
|
|
- dns_view_detach(&view);
|
|
|
|
fail1:
|
|
|
|
return (result);
|
|
|
|
}
|