Commit edcb93b4 authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

wired up view options: request-ixfr, provide-ixfr

parent 3676eeb6
......@@ -45,7 +45,6 @@ struct ns_server {
isc_quota_t xfroutquota;
isc_quota_t tcpquota;
isc_quota_t recursionquota;
isc_boolean_t provide_ixfr;
/* Not really configurable, but covered by conflock. */
dns_aclenv_t aclenv;
......
......@@ -361,8 +361,23 @@ configure_view(dns_view_t *view, dns_c_ctx_t *cctx, dns_c_view_t *cview,
dns_c_view_getrecursionacl,
dns_c_ctx_getallowrecursion,
&view->recursionacl));
result = ISC_R_NOTFOUND;
if (cview != NULL)
result = dns_c_view_getrequestixfr(cview, &view->requestixfr);
if (result != ISC_R_SUCCESS)
result = dns_c_ctx_getrequestixfr(cctx, &view->requestixfr);
if (result != ISC_R_SUCCESS)
view->requestixfr = ISC_TRUE;
result = ISC_R_NOTFOUND;
if (cview != NULL)
result = dns_c_view_getprovideixfr(cview, &view->provideixfr);
if (result != ISC_R_SUCCESS)
result = dns_c_ctx_getprovideixfr(cctx, &view->provideixfr);
if (result != ISC_R_SUCCESS)
view->provideixfr = ISC_TRUE;
cleanup:
RWUNLOCK(&view->conflock, isc_rwlocktype_write);
......@@ -973,9 +988,6 @@ load_configuration(const char *filename, ns_server_t *server,
configure_server_quota(configctx, dns_c_ctx_getrecursiveclients,
&server->recursionquota, 100);
(void) dns_c_ctx_getprovideixfr(configctx, &server->provide_ixfr);
/*
* Configure the zone manager.
*/
......@@ -989,12 +1001,6 @@ load_configuration(const char *filename, ns_server_t *server,
(void) dns_c_ctx_gettransfersperns(configctx, &transfersperns);
dns_zonemgr_settransfersperns(server->zonemgr, transfersperns);
}
{
isc_boolean_t requestixfr = ISC_TRUE;
(void) dns_c_ctx_getrequestixfr(configctx, &requestixfr);
dns_zonemgr_setrequestixfr(server->zonemgr, requestixfr);
}
/*
* Configure the interface manager according to the "listen-on"
......@@ -1305,8 +1311,6 @@ ns_server_create(isc_mem_t *mctx, ns_server_t **serverp) {
result = isc_quota_init(&server->recursionquota, 100);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
server->provide_ixfr = ISC_TRUE;
result = dns_aclenv_init(mctx, &server->aclenv);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: xfrout.c,v 1.54 2000/04/07 19:17:33 explorer Exp $ */
/* $Id: xfrout.c,v 1.55 2000/04/07 22:30:41 gson Exp $ */
#include <config.h>
......@@ -949,7 +949,7 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype)
* Outgoing IXFR may have been disabled for this peer
* or globally.
*/
provide_ixfr = ns_g_server->provide_ixfr;
provide_ixfr = client->view->provideixfr;
if (peer != NULL)
(void) dns_peer_getprovideixfr(peer, &provide_ixfr);
if (provide_ixfr == ISC_FALSE)
......
......@@ -100,7 +100,9 @@ struct dns_view {
dns_transfer_format_t transfer_format;
dns_acl_t * queryacl;
dns_acl_t * recursionacl;
isc_boolean_t requestixfr;
isc_boolean_t provideixfr;
/*
* Configurable data for server use only,
* locked by server configuration lock.
......
......@@ -895,12 +895,6 @@ dns_zonemgr_getttransfersperns(dns_zonemgr_t *zmgr);
dns_xfrinlist_t *
dns_zonemgr_gettransferlist(dns_zonemgr_t *zmgr);
void
dns_zonemgr_setrequestixfr(dns_zonemgr_t *zmgr, isc_boolean_t value);
isc_boolean_t
dns_zonemgr_getrequestixfr(dns_zonemgr_t *zmgr);
ISC_LANG_ENDDECLS
#endif /* DNS_ZONE_H */
......@@ -141,6 +141,8 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
view->transfer_format = dns_one_answer;
view->queryacl = NULL;
view->recursionacl = NULL;
view->requestixfr = ISC_TRUE;
view->provideixfr = ISC_TRUE;
result = dns_peerlist_new(view->mctx, &view->peers);
if (result != ISC_R_SUCCESS)
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: xfrin.c,v 1.60 2000/04/07 19:38:50 gson Exp $ */
/* $Id: xfrin.c,v 1.61 2000/04/07 22:30:42 gson Exp $ */
#include <config.h>
......@@ -559,8 +559,7 @@ dns_xfrin_create(dns_zone_t *zone, isc_sockaddr_t *masteraddr,
ISC_R_SUCCESS) {
; /* Using peer setting */
} else {
use_ixfr = dns_zonemgr_getrequestixfr(
dns_zone_getmgr(zone));
use_ixfr = dns_zone_getview(zone)->requestixfr;
}
if (use_ixfr == ISC_FALSE) {
xfrin_log1(ISC_LOG_DEBUG(3), zonename, masteraddr,
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: zone.c,v 1.90 2000/04/06 22:02:34 explorer Exp $ */
/* $Id: zone.c,v 1.91 2000/04/07 22:30:42 gson Exp $ */
#include <config.h>
......@@ -201,7 +201,6 @@ struct dns_zonemgr {
/* Locked by conflock. */
int transfersin;
int transfersperns;
isc_boolean_t requestixfr;
/* Contains its own lock. */
dns_xfrinlist_t transferlist;
};
......@@ -3332,16 +3331,6 @@ dns_zonemgr_gettransferlist(dns_zonemgr_t *zmgr) {
return (&zmgr->transferlist);
}
void
dns_zonemgr_setrequestixfr(dns_zonemgr_t *zmgr, isc_boolean_t value) {
zmgr->requestixfr = value;
}
isc_boolean_t
dns_zonemgr_getrequestixfr(dns_zonemgr_t *zmgr) {
return (zmgr->requestixfr);
}
#if 0
/* hook for ondestroy notifcation from a database. */
......
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