zoneconf.c revision 3aca8e5bf3740bbcc3bb13dde242d7cc369abb27
69fe9aaafdd6a141610e86a777d325db75422070Mark Andrews * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * Copyright (C) 1999-2003 Internet Software Consortium.
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence * Permission to use, copy, modify, and distribute this software for any
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence * purpose with or without fee is hereby granted, provided that the above
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence * copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉/* $Id: zoneconf.c,v 1.119 2005/02/10 05:53:42 marka Exp $ */
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence#include <isc/string.h> /* Required for HP/UX (and others?) */
c80dde0676a7f36f65e0ad8d646bf505705fe64bDavid Lawrence * These are BIND9 server defaults, not necessarily identical to the
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence * library defaults defined in zone.c.
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence#define RETERR(x) do { \
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence * Convenience function for configuring a single zone ACL.
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrenceconfigure_zone_acl(cfg_obj_t *zconfig, cfg_obj_t *vconfig, cfg_obj_t *config,
0f5962ac3e4ef336faff68f1cb838505e64665e5David Lawrence maps[i++] = cfg_tuple_get(zconfig, "options");
0f5962ac3e4ef336faff68f1cb838505e64665e5David Lawrence maps[i++] = cfg_tuple_get(vconfig, "options");
f036af2c718147408d738081cdb0a564b981b4cdDavid Lawrence (void)cfg_map_get(config, "options", &options);
a09c545af1ceb8eb6f3aa2bb6fae286208a72141David Lawrence result = ns_config_get(maps, aclname, &aclobj);
cec7a04adc665a8c1029be008fd97c018c12c1b3David Lawrence result = cfg_acl_fromconfig(aclobj, config, ns_g_lctx, actx,
593d951248f799e90d30bc69bb89342000b012cdBob Halley * Parse the zone update-policy statement.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austeinconfigure_zone_ssutable(cfg_obj_t *zconfig, dns_zone_t *zone) {
f036af2c718147408d738081cdb0a564b981b4cdDavid Lawrence (void)cfg_map_get(zconfig, "update-policy", &updatepolicy);
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence cfg_obj_t *stmt = cfg_listelt_value(element);
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence cfg_obj_t *mode = cfg_tuple_get(stmt, "mode");
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence cfg_obj_t *identity = cfg_tuple_get(stmt, "identity");
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence cfg_obj_t *matchtype = cfg_tuple_get(stmt, "matchtype");
33950f0a0262f4d49528c4adcf8be42807fa2576David Lawrence cfg_obj_t *dname = cfg_tuple_get(stmt, "name");
f036af2c718147408d738081cdb0a564b981b4cdDavid Lawrence cfg_obj_t *typelist = cfg_tuple_get(stmt, "types");
1630fce031f7a3e33f0579e477a3e17d1993e1f9Bob Halley unsigned int i, n;
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence result = dns_name_fromtext(dns_fixedname_name(&fident), &b,
84f8cc7e22cccde283627f6df6b8b74ec473cdc9David Lawrence cfg_obj_log(identity, ns_g_lctx, ISC_LOG_ERROR,
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence result = dns_name_fromtext(dns_fixedname_name(&fname), &b,
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence cfg_obj_log(identity, ns_g_lctx, ISC_LOG_ERROR,
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence types = isc_mem_get(mctx, n * sizeof(dns_rdatatype_t));
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence result = dns_rdatatype_fromtext(&types[i++], &r);
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence cfg_obj_log(identity, ns_g_lctx, ISC_LOG_ERROR,
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence isc_mem_put(mctx, types, n * sizeof(dns_rdatatype_t));
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence * Convert a config file zone type into a server zone type.
7554feaef6057f5ea2926076900ac7634b911456Mark Andrews * Helper function for strtoargv(). Pardon the gratuitous recursion.
7554feaef6057f5ea2926076900ac7634b911456Mark Andrewsstrtoargvsub(isc_mem_t *mctx, char *s, unsigned int *argcp,
7554feaef6057f5ea2926076900ac7634b911456Mark Andrews char ***argvp, unsigned int n)
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence /* Discard leading whitespace. */
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence if (*s == '\0') {
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 /* We have reached the end of the string. */
5597be9bb88de138dfec9fa9176708443813925eTatuya JINMEI 神明達哉 *argvp = isc_mem_get(mctx, n * sizeof(char *));
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence while (*p != ' ' && *p != '\t' && *p != '\0')
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence if (*p != '\0')
a03848252fa85734ca75beae3d0b01bb503c0a8bMark Andrews result = strtoargvsub(mctx, p, argcp, argvp, n + 1);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence * Tokenize the string "s" into whitespace-separated words,
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence * return the number of words in '*argcp' and an array
40e7c805a8f38ad9b20dd6c688496fc09fc971c2Mark Andrews * of pointers to the words in '*argvp'. The caller
a03848252fa85734ca75beae3d0b01bb503c0a8bMark Andrews * must free the array using isc_mem_put(). The string
a03848252fa85734ca75beae3d0b01bb503c0a8bMark Andrews * is modified in-place.
83e6eb0dfe7d3525dcf093f440e04e8971c4c5d2Brian Wellingtonstrtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp) {
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence return (strtoargvsub(mctx, s, argcp, argvp, 0));
73d62a89f1493865c33c689b3ee3de91c74ad58eDavid Lawrencechecknames(dns_zonetype_t ztype, cfg_obj_t **maps, cfg_obj_t **objp) {
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence case dns_zone_master: zone = "master"; break;
83e6eb0dfe7d3525dcf093f440e04e8971c4c5d2Brian Wellington result = ns_checknames_get(maps, zone, objp);
ec80744ad68b97f15657b1fdf5591c30b559b57dDavid Lawrencens_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
15bc0af6a1e7e1701179d22db729416e584ae904Brian Wellington dns_notifytype_t notifytype = dns_notifytype_yes;
ec80744ad68b97f15657b1fdf5591c30b559b57dDavid Lawrence unsigned int dbargc;
15bc0af6a1e7e1701179d22db729416e584ae904Brian Wellington dns_dialuptype_t dialup = dns_dialuptype_no;
19c5c23ef6e38965949c996592bd92478da0612cMark Andrews isc_boolean_t check = ISC_FALSE, fail = ISC_FALSE;
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence zoptions = cfg_tuple_get(zconfig, "options");
ec80744ad68b97f15657b1fdf5591c30b559b57dDavid Lawrence maps[i++] = cfg_tuple_get(vconfig, "options");
ec80744ad68b97f15657b1fdf5591c30b559b57dDavid Lawrence (void)cfg_map_get(config, "options", &options);
ec80744ad68b97f15657b1fdf5591c30b559b57dDavid Lawrence RETERR(ns_config_getclass(cfg_tuple_get(vconfig, "class"),
0f5962ac3e4ef336faff68f1cb838505e64665e5David Lawrence * Configure values common to all zone types.
005c7ad70f55a6e4333808cdf63811777254c339David Lawrence zname = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
40e7c805a8f38ad9b20dd6c688496fc09fc971c2Mark Andrews RETERR(ns_config_getclass(cfg_tuple_get(zconfig, "class"),
587fc7b519b0fed4e3dd234527edba1ca9334757David Lawrence result = cfg_map_get(zoptions, "database", &obj);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence RETERR(strtoargv(mctx, cpval, &dbargc, &dbargv));
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence * ANSI C is strange here. There is no logical reason why (char **)
b6309ed962c4988a314d61742c4fbc4935467d68Mark Andrews * cannot be promoted automatically to (const char * const *) by the
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence * compiler w/o generating a warning.
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence RETERR(dns_zone_setdbtype(zone, dbargc, (const char * const *)dbargv));
df1e2d496e50f6fea810a5ed12f0e290f4261ab3David Lawrence isc_mem_put(mctx, dbargv, dbargc * sizeof(*dbargv));
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence result = cfg_map_get(zoptions, "file", &obj);
40e7c805a8f38ad9b20dd6c688496fc09fc971c2Mark Andrews result = cfg_map_get(zoptions, "journal", &obj);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence RETERR(dns_zone_setjournal(zone, cfg_obj_asstring(obj)));
ec80744ad68b97f15657b1fdf5591c30b559b57dDavid Lawrence RETERR(configure_zone_acl(zconfig, vconfig, config,
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence * XXXAG This probably does not make sense for stubs.
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence RETERR(configure_zone_acl(zconfig, vconfig, config,
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence else if (strcasecmp(dialupstr, "notify-passive") == 0)
0f5962ac3e4ef336faff68f1cb838505e64665e5David Lawrence else if (strcasecmp(dialupstr, "refresh") == 0)
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence else if (strcasecmp(dialupstr, "passive") == 0)
005c7ad70f55a6e4333808cdf63811777254c339David Lawrence result = ns_config_get(maps, "zone-statistics", &obj);
005c7ad70f55a6e4333808cdf63811777254c339David Lawrence RETERR(dns_zone_setstatistics(zone, cfg_obj_asboolean(obj)));
005c7ad70f55a6e4333808cdf63811777254c339David Lawrence * Configure master functionality. This applies
005c7ad70f55a6e4333808cdf63811777254c339David Lawrence * to primary masters (type "master") and slaves
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence * acting as masters (type "slave"), but not to stubs.
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence result = ns_config_get(maps, "notify", &obj);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence else if (strcasecmp(notifystr, "master-only") == 0)
e407562a75eb93073bb72089cced150d7ffe4d4fTatuya JINMEI 神明達哉 result = ns_config_get(maps, "also-notify", &obj);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence result = ns_config_getiplist(config, obj, 0, mctx,
510f4bdcb66acbec3f276efaacecbebea891c868David Lawrence ns_config_putiplist(mctx, &addrs, addrcount);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence RETERR(dns_zone_setalsonotify(zone, NULL, 0));
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence result = ns_config_get(maps, "notify-source", &obj);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence RETERR(dns_zone_setnotifysrc4(zone, cfg_obj_assockaddr(obj)));
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence ns_add_reserved_dispatch(ns_g_server, cfg_obj_assockaddr(obj));
005c7ad70f55a6e4333808cdf63811777254c339David Lawrence result = ns_config_get(maps, "notify-source-v6", &obj);
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence RETERR(dns_zone_setnotifysrc6(zone, cfg_obj_assockaddr(obj)));
f036af2c718147408d738081cdb0a564b981b4cdDavid Lawrence ns_add_reserved_dispatch(ns_g_server, cfg_obj_assockaddr(obj));
84f8cc7e22cccde283627f6df6b8b74ec473cdc9David Lawrence dns_zone_setisself(zone, ns_client_isself, NULL);
84f8cc7e22cccde283627f6df6b8b74ec473cdc9David Lawrence RETERR(configure_zone_acl(zconfig, vconfig, config,
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence result = ns_config_get(maps, "max-transfer-time-out", &obj);
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence dns_zone_setmaxxfrout(zone, cfg_obj_asuint32(obj) * 60);
84f8cc7e22cccde283627f6df6b8b74ec473cdc9David Lawrence result = ns_config_get(maps, "max-transfer-idle-out", &obj);
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence dns_zone_setidleout(zone, cfg_obj_asuint32(obj) * 60);
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence result = ns_config_get(maps, "max-journal-size", &obj);
5d4f11b265c396d71ec2162a632e620425481a9eDavid Lawrence "'max-journal-size "
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence "is too large",
510f4bdcb66acbec3f276efaacecbebea891c868David Lawrence result = ns_config_get(maps, "ixfr-from-differences", &obj);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence else if (strcasecmp(cfg_obj_asstring(obj), "master") &&
d65db52903505c1bcbc6dd1651e9f9f347e48217David Lawrence else if (strcasecmp(cfg_obj_asstring(obj), "slave") &&
5d4f11b265c396d71ec2162a632e620425481a9eDavid Lawrence dns_zone_setoption(zone, DNS_ZONEOPT_IXFRFROMDIFFS, ixfrdiff);
5d4f11b265c396d71ec2162a632e620425481a9eDavid Lawrence if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence } else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence } else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence dns_zone_setoption(zone, DNS_ZONEOPT_CHECKNAMES, check);
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence dns_zone_setoption(zone, DNS_ZONEOPT_CHECKNAMESFAIL, fail);
73d62a89f1493865c33c689b3ee3de91c74ad58eDavid Lawrence result = ns_config_get(maps, "notify-delay", &obj);
f036af2c718147408d738081cdb0a564b981b4cdDavid Lawrence dns_zone_setnotifydelay(zone, cfg_obj_asuint32(obj));
f036af2c718147408d738081cdb0a564b981b4cdDavid Lawrence * Configure update-related options. These apply to
510f4bdcb66acbec3f276efaacecbebea891c868David Lawrence * primary masters only.
f036af2c718147408d738081cdb0a564b981b4cdDavid Lawrence RETERR(configure_zone_acl(zconfig, vconfig, config,
40e7c805a8f38ad9b20dd6c688496fc09fc971c2Mark Andrews if (updateacl != NULL && dns_acl_isinsecure(updateacl))
40e7c805a8f38ad9b20dd6c688496fc09fc971c2Mark Andrews isc_log_write(ns_g_lctx, DNS_LOGCATEGORY_SECURITY,
40e7c805a8f38ad9b20dd6c688496fc09fc971c2Mark Andrews "zone '%s' allows updates by IP "
83e6eb0dfe7d3525dcf093f440e04e8971c4c5d2Brian Wellington "address, which is insecure",
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence RETERR(configure_zone_ssutable(zoptions, zone));
0f5962ac3e4ef336faff68f1cb838505e64665e5David Lawrence result = ns_config_get(maps, "sig-validity-interval", &obj);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence result = ns_config_get(maps, "key-directory", &obj);
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence "key-directory '%s' "
e94e2fe29db85dd7872cbd4635aa50d5e2883c8aDavid Lawrence RETERR(dns_zone_setkeydirectory(zone, filename));
5d4f11b265c396d71ec2162a632e620425481a9eDavid Lawrence result = ns_config_get(maps, "check-wildcard", &obj);
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence dns_zone_setoption(zone, DNS_ZONEOPT_CHECKWILDCARD, check);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence RETERR(configure_zone_acl(zconfig, vconfig, config,
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence * Configure slave functionality.
83e6eb0dfe7d3525dcf093f440e04e8971c4c5d2Brian Wellington result = cfg_map_get(zoptions, "masters", &obj);
8e1f35e1d738e0bd22ab7971f0ec875a473eb1a2David Lawrence RETERR(ns_config_getipandkeylist(config, obj, mctx,
0f5962ac3e4ef336faff68f1cb838505e64665e5David Lawrence result = dns_zone_setmasterswithkeys(zone, addrs,
bd1190c84b08e61a12789c54f083318c36449e5eDavid Lawrence ns_config_putipandkeylist(mctx, &addrs, &keynames,
0f5962ac3e4ef336faff68f1cb838505e64665e5David Lawrence result = ns_config_get(maps, "multi-master", &obj);
bd1190c84b08e61a12789c54f083318c36449e5eDavid Lawrence dns_zone_setoption(zone, DNS_ZONEOPT_MULTIMASTER, multi);
bd1190c84b08e61a12789c54f083318c36449e5eDavid Lawrence result = ns_config_get(maps, "max-transfer-time-in", &obj);
bd1190c84b08e61a12789c54f083318c36449e5eDavid Lawrence dns_zone_setmaxxfrin(zone, cfg_obj_asuint32(obj) * 60);
5d4f11b265c396d71ec2162a632e620425481a9eDavid Lawrence result = ns_config_get(maps, "max-transfer-idle-in", &obj);
5d4f11b265c396d71ec2162a632e620425481a9eDavid Lawrence dns_zone_setidlein(zone, cfg_obj_asuint32(obj) * 60);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence result = ns_config_get(maps, "max-refresh-time", &obj);
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence dns_zone_setmaxrefreshtime(zone, cfg_obj_asuint32(obj));
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence result = ns_config_get(maps, "min-refresh-time", &obj);
194f54f4da604a6601edefa2175d48412e01bf2fDavid Lawrence dns_zone_setminrefreshtime(zone, cfg_obj_asuint32(obj));
5f50687f61057f7f0acb161d5803f4a48e40b3a8David Lawrence result = ns_config_get(maps, "max-retry-time", &obj);
c5945fe694dd3d9db54647e5a06ba184a074b620Brian Wellington dns_zone_setmaxretrytime(zone, cfg_obj_asuint32(obj));
df1e2d496e50f6fea810a5ed12f0e290f4261ab3David Lawrence result = ns_config_get(maps, "min-retry-time", &obj);
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff dns_zone_setminretrytime(zone, cfg_obj_asuint32(obj));
587fc7b519b0fed4e3dd234527edba1ca9334757David Lawrence result = ns_config_get(maps, "transfer-source", &obj);
c4c843edb3f4c609e3552ee77a43400852400467David Lawrence RETERR(dns_zone_setxfrsource4(zone, cfg_obj_assockaddr(obj)));
891a1bead8d02d29eb7b4993d7c0975047b0963dDavid Lawrence ns_add_reserved_dispatch(ns_g_server, cfg_obj_assockaddr(obj));
d7197f2ab048f882cc9f331371096347b9f73df8David Lawrence result = ns_config_get(maps, "transfer-source-v6", &obj);
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence RETERR(dns_zone_setxfrsource6(zone, cfg_obj_assockaddr(obj)));
ec80744ad68b97f15657b1fdf5591c30b559b57dDavid Lawrence ns_add_reserved_dispatch(ns_g_server, cfg_obj_assockaddr(obj));
33950f0a0262f4d49528c4adcf8be42807fa2576David Lawrence result = ns_config_get(maps, "alt-transfer-source", &obj);
d7197f2ab048f882cc9f331371096347b9f73df8David Lawrence RETERR(dns_zone_setaltxfrsource4(zone, cfg_obj_assockaddr(obj)));
ec80744ad68b97f15657b1fdf5591c30b559b57dDavid Lawrence result = ns_config_get(maps, "alt-transfer-source-v6", &obj);
ec80744ad68b97f15657b1fdf5591c30b559b57dDavid Lawrence RETERR(dns_zone_setaltxfrsource6(zone, cfg_obj_assockaddr(obj)));
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence (void)ns_config_get(maps, "use-alt-transfer-source", &obj);
b6309ed962c4988a314d61742c4fbc4935467d68Mark Andrews * Default off when views are in use otherwise
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence * on for BIND 8 compatibility.
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence if (view != NULL && strcmp(view->name, "_default") == 0)
f389bc2c9e9e434380e10221778b7b548612a67fDavid Lawrence dns_zone_setoption(zone, DNS_ZONEOPT_USEALTXFRSRC, alt);
5d4f11b265c396d71ec2162a632e620425481a9eDavid Lawrencens_zone_reusable(dns_zone_t *zone, cfg_obj_t *zconfig) {
93b01c72951b56eeddf8d4bdceb06785b322e1fdDavid Lawrence zoptions = cfg_tuple_get(zconfig, "options");
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence if (zonetype_fromconfig(zoptions) != dns_zone_gettype(zone))
b65f2ab14abb4b6ef906d7d02064fba158f07b1eDavid Lawrence if (!((cfilename == NULL && zfilename == NULL) ||