From e8cf926e39803969efac6ab31921a76ff57ff613 Mon Sep 17 00:00:00 2001 From: James Brister Date: Sat, 11 Dec 1999 14:07:19 +0000 Subject: [PATCH] Fix (and test) for max-transfer statements inside zones. --- bin/tests/named.conf | 3 ++ lib/dns/config/confparser.y | 77 ++++++++++++++++++++++++++++++++++++- 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/bin/tests/named.conf b/bin/tests/named.conf index 6b6d4252d0..df51738c99 100644 --- a/bin/tests/named.conf +++ b/bin/tests/named.conf @@ -209,6 +209,9 @@ zone "slave.demo.zone" { allow-transfer { any; }; allow-query { any; }; max-transfer-time-in 120; // if not set, global option is used. + max-transfer-time-out 1; // if not set, global option is used. + max-transfer-idle-in 2; // if not set, global option is used. + max-transfer-idle-out 3; // if not set, global option is used. also-notify { }; // don't notify any nameservers other // than those on the NS list for this // zone diff --git a/lib/dns/config/confparser.y b/lib/dns/config/confparser.y index 8ce9223699..33239db71a 100644 --- a/lib/dns/config/confparser.y +++ b/lib/dns/config/confparser.y @@ -17,7 +17,7 @@ */ #if !defined(lint) && !defined(SABER) -static char rcsid[] = "$Id: confparser.y,v 1.29 1999/12/11 13:44:43 brister Exp $"; +static char rcsid[] = "$Id: confparser.y,v 1.30 1999/12/11 14:07:19 brister Exp $"; #endif /* not lint */ #include @@ -2944,6 +2944,81 @@ zone_option: L_FILE L_QSTRING break; } } + | L_MAX_TRANSFER_TIME_OUT L_INTEGER + { + dns_c_zone_t *zone = dns_c_ctx_getcurrzone(currcfg); + + INSIST(zone != NULL); + + tmpres = dns_c_zone_setmaxtranstimeout(zone, $2); + switch (tmpres) { + case ISC_R_EXISTS: + parser_warning(ISC_FALSE, + "Redefining zone " + "max-transfer-time-out."); + break; + + case ISC_R_SUCCESS: + /* nothing */ + break; + + default: + parser_error(ISC_FALSE, + "Failed to set zone " + "max-transfer-time-out."); + break; + } + } + | L_MAX_TRANSFER_IDLE_IN L_INTEGER + { + dns_c_zone_t *zone = dns_c_ctx_getcurrzone(currcfg); + + INSIST(zone != NULL); + + tmpres = dns_c_zone_setmaxtransidlein(zone, $2); + switch (tmpres) { + case ISC_R_EXISTS: + parser_warning(ISC_FALSE, + "Redefining zone " + "max-transfer-idle-in."); + break; + + case ISC_R_SUCCESS: + /* nothing */ + break; + + default: + parser_error(ISC_FALSE, + "Failed to set zone " + "max-transfer-idle-in."); + break; + } + } + | L_MAX_TRANSFER_IDLE_OUT L_INTEGER + { + dns_c_zone_t *zone = dns_c_ctx_getcurrzone(currcfg); + + INSIST(zone != NULL); + + tmpres = dns_c_zone_setmaxtransidleout(zone, $2); + switch (tmpres) { + case ISC_R_EXISTS: + parser_warning(ISC_FALSE, + "Redefining zone " + "max-transfer-idle-out."); + break; + + case ISC_R_SUCCESS: + /* nothing */ + break; + + default: + parser_error(ISC_FALSE, + "Failed to set zone " + "max-transfer-idle-out."); + break; + } + } | L_MAX_LOG_SIZE_IXFR L_INTEGER { dns_c_zone_t *zone = dns_c_ctx_getcurrzone(currcfg);