Commit 66e2dd50 authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

wired up view options: recursion, auth-nxdomain, transfer-format

parent a38ea1c6
......@@ -2607,7 +2607,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event) {
* response.
*/
if (client->message->rcode == dns_rcode_nxdomain &&
ns_g_server->auth_nxdomain == ISC_TRUE)
client->view->auth_nxdomain == ISC_TRUE)
client->message->flags |= DNS_MESSAGEFLAG_AA;
ns_client_send(client);
......
......@@ -340,6 +340,21 @@ configure_view(dns_view_t *view, dns_c_ctx_t *cctx, dns_c_view_t *cview,
dns_c_view_getmatchclients, NULL,
&view->matchclients));
/*
* Configure other configurable data.
*/
view->recursion = ISC_TRUE;
(void) dns_c_ctx_getrecursion(cctx, &view->recursion);
(void) dns_c_view_getrecursion(cview, &view->recursion);
view->auth_nxdomain = ISC_FALSE; /* Was true in BIND 8 */
(void) dns_c_ctx_getauthnxdomain(cctx, &view->auth_nxdomain);
(void) dns_c_view_getauthnxdomain(cview, &view->auth_nxdomain);
view->transfer_format = dns_one_answer;
(void) dns_c_ctx_gettransferformat(cctx, &view->transfer_format);
(void) dns_c_view_gettransferformat(cview, &view->transfer_format);
cleanup:
RWUNLOCK(&view->conflock, isc_rwlocktype_write);
......@@ -943,11 +958,6 @@ load_configuration(const char *filename, ns_server_t *server,
/*
* Configure various server options.
*/
(void) dns_c_ctx_getrecursion(configctx, &server->recursion);
(void) dns_c_ctx_getauthnxdomain(configctx, &server->auth_nxdomain);
(void) dns_c_ctx_gettransferformat(configctx,
&server->transfer_format);
CHECK(configure_server_acl(configctx, &aclconfctx, ns_g_mctx,
dns_c_ctx_getallowquery,
&server->queryacl));
......@@ -1286,9 +1296,6 @@ ns_server_create(isc_mem_t *mctx, ns_server_t **serverp) {
"initializing server configuration lock");
/* Initialize configuration data with default values. */
server->recursion = ISC_TRUE;
server->auth_nxdomain = ISC_FALSE; /* Was true in BIND 8 */
server->transfer_format = dns_one_answer;
server->queryacl = NULL;
server->recursionacl = NULL;
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: xfrout.c,v 1.51 2000/04/04 19:14:05 gson Exp $ */
/* $Id: xfrout.c,v 1.52 2000/04/06 20:25:48 gson Exp $ */
#include <config.h>
......@@ -805,7 +805,7 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype)
dns_message_t *request = client->message;
xfrout_ctx_t *xfr = NULL;
isc_quota_t *quota = NULL;
dns_transfer_format_t format = ns_g_server->transfer_format;
dns_transfer_format_t format = client->view->transfer_format;
isc_netaddr_t na;
dns_peer_t *peer = NULL;
......
......@@ -95,6 +95,10 @@ struct dns_view {
dns_tsig_keyring_t * statickeys;
dns_tsig_keyring_t * dynamickeys;
dns_peerlist_t * peers;
isc_boolean_t recursion;
isc_boolean_t auth_nxdomain;
dns_transfer_format_t transfer_format;
/*
* Configurable data for server use only,
* locked by server configuration lock.
......
......@@ -134,6 +134,12 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
if (result != DNS_R_SUCCESS)
goto cleanup_trustedkeys;
view->peers = NULL;
/* Initialize configuration data with default values. */
view->recursion = ISC_TRUE;
view->auth_nxdomain = ISC_FALSE; /* Was true in BIND 8 */
view->transfer_format = dns_one_answer;
result = dns_peerlist_new(view->mctx, &view->peers);
if (result != DNS_R_SUCCESS)
goto cleanup_dynkeys;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment