From cb284e7bd479a4309bfa9ccfb139a07ceb3edfd6 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Fri, 7 Apr 2000 17:27:22 +0000 Subject: [PATCH] wired up view options: transfer-source, transfer-source-v6 --- bin/named/zoneconf.c | 40 ++++++++++++++++++++-------------------- lib/dns/zoneconf.c | 40 ++++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index e891619474..1d07290844 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -284,21 +284,21 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview, dns_zone_setidlein(zone, maxxfr); result = dns_c_zone_gettransfersource(czone, &sockaddr); - if (result != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersource(cview, &sockaddr); + if (result != ISC_R_SUCCESS) result = dns_c_ctx_gettransfersource(cctx, &sockaddr); - if (result != ISC_R_SUCCESS) { - sockaddr = sockaddr_any4; - } - } + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any4; dns_zone_setxfrsource4(zone, &sockaddr); result = dns_c_zone_gettransfersourcev6(czone, &sockaddr); - if (result != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersourcev6(cview, &sockaddr); + if (result != ISC_R_SUCCESS) result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr); - if (result != ISC_R_SUCCESS) { - sockaddr = sockaddr_any6; - } - } + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any6; dns_zone_setxfrsource6(zone, &sockaddr); result = dns_c_zone_getmaxtranstimeout(czone, &maxxfr); @@ -376,21 +376,21 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview, dns_zone_setidlein(zone, maxxfr); result = dns_c_zone_gettransfersource(czone, &sockaddr); - if (result != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersource(cview, &sockaddr); + if (result != ISC_R_SUCCESS) result = dns_c_ctx_gettransfersource(cctx, &sockaddr); - if (result != ISC_R_SUCCESS) { - sockaddr = sockaddr_any4; - } - } + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any4; dns_zone_setxfrsource4(zone, &sockaddr); result = dns_c_zone_gettransfersourcev6(czone, &sockaddr); - if (result != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersourcev6(cview, &sockaddr); + if (result != ISC_R_SUCCESS) result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr); - if (result != ISC_R_SUCCESS) { - sockaddr = sockaddr_any6; - } - } + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any6; dns_zone_setxfrsource6(zone, &sockaddr); case dns_c_zone_hint: diff --git a/lib/dns/zoneconf.c b/lib/dns/zoneconf.c index e891619474..1d07290844 100644 --- a/lib/dns/zoneconf.c +++ b/lib/dns/zoneconf.c @@ -284,21 +284,21 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview, dns_zone_setidlein(zone, maxxfr); result = dns_c_zone_gettransfersource(czone, &sockaddr); - if (result != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersource(cview, &sockaddr); + if (result != ISC_R_SUCCESS) result = dns_c_ctx_gettransfersource(cctx, &sockaddr); - if (result != ISC_R_SUCCESS) { - sockaddr = sockaddr_any4; - } - } + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any4; dns_zone_setxfrsource4(zone, &sockaddr); result = dns_c_zone_gettransfersourcev6(czone, &sockaddr); - if (result != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersourcev6(cview, &sockaddr); + if (result != ISC_R_SUCCESS) result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr); - if (result != ISC_R_SUCCESS) { - sockaddr = sockaddr_any6; - } - } + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any6; dns_zone_setxfrsource6(zone, &sockaddr); result = dns_c_zone_getmaxtranstimeout(czone, &maxxfr); @@ -376,21 +376,21 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview, dns_zone_setidlein(zone, maxxfr); result = dns_c_zone_gettransfersource(czone, &sockaddr); - if (result != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersource(cview, &sockaddr); + if (result != ISC_R_SUCCESS) result = dns_c_ctx_gettransfersource(cctx, &sockaddr); - if (result != ISC_R_SUCCESS) { - sockaddr = sockaddr_any4; - } - } + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any4; dns_zone_setxfrsource4(zone, &sockaddr); result = dns_c_zone_gettransfersourcev6(czone, &sockaddr); - if (result != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS && cview != NULL) + result = dns_c_view_gettransfersourcev6(cview, &sockaddr); + if (result != ISC_R_SUCCESS) result = dns_c_ctx_gettransfersourcev6(cctx, &sockaddr); - if (result != ISC_R_SUCCESS) { - sockaddr = sockaddr_any6; - } - } + if (result != ISC_R_SUCCESS) + sockaddr = sockaddr_any6; dns_zone_setxfrsource6(zone, &sockaddr); case dns_c_zone_hint: