Commit 6314cd33 authored by Mark Andrews's avatar Mark Andrews
Browse files

Support $TTL w/ BIND 8 format

dns_ttl_fromtext() to return DNS_R_BADTTL not DNS_R_SYNTAX.
parent ecda7175
......@@ -66,7 +66,7 @@ dns_ttl_fromtext(isc_textregion_t *source, isc_uint32_t *ttl);
*
* Returns:
* DNS_R_SUCCESS
* DNS_R_SYNTAX
* DNS_R_BADTTL
*/
ISC_LANG_ENDDECLS
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: master.c,v 1.28 1999/11/02 13:07:51 marka Exp $ */
/* $Id: master.c,v 1.29 1999/11/04 01:21:27 marka Exp $ */
#include <config.h>
......@@ -281,16 +281,12 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin,
finish_origin = ISC_TRUE;
} else if (strcasecmp(token.value.as_pointer,
"$TTL") == 0) {
GETTOKEN(lex, ISC_LEXOPT_NUMBER, &token,
ISC_FALSE);
if (token.type != isc_tokentype_number) {
(callbacks->warn)(callbacks,
"dns_master_load: %s:%d $TTL expects number\n",
isc_lex_getsourcename(lex),
isc_lex_getsourceline(lex));
result = DNS_R_BADTTL;
goto cleanup;
}
GETTOKEN(lex, 0, &token, ISC_FALSE);
result =
dns_ttl_fromtext(&token.value.as_textregion,
&ttl);
if (result != DNS_R_SUCCESS)
goto cleanup;
ttl = token.value.as_ulong;
if (ttl > 0x7fffffffUL) {
(callbacks->warn)(callbacks,
......@@ -301,7 +297,6 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin,
ttl = 0;
}
default_ttl = ttl;
ttl_known = ISC_TRUE;
default_ttl_known = ISC_TRUE;
read_till_eol = ISC_TRUE;
continue;
......
......@@ -125,7 +125,12 @@ dns_counter_fromtext(isc_textregion_t *source, isc_uint32_t *ttl) {
dns_result_t
dns_ttl_fromtext(isc_textregion_t *source, isc_uint32_t *ttl) {
return (bind_ttl(source, ttl));
dns_result_t result;
result = bind_ttl(source, ttl);
if (result != DNS_R_SUCCESS)
result = DNS_R_BADTTL;
return (result);
}
static dns_result_t
......
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